Skip to content

Commit 09002bb

Browse files
authored
Initial commit. (#1)
Mostly copied from pkg-fs.
1 parent 0787404 commit 09002bb

File tree

15 files changed

+349
-3
lines changed

15 files changed

+349
-3
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions" # Necessary to update action hashs.
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
# Allow up to 3 opened pull requests for github-actions versions.
8+
open-pull-requests-limit: 3

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Zero-Clause BSD License
2+
3+
# Copyright (C) 2024 Toitware ApS.
4+
5+
# Permission to use, copy, modify, and/or distribute this software for any
6+
# purpose with or without fee is hereby granted.
7+
8+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9+
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
10+
# FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11+
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12+
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13+
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14+
# PERFORMANCE OF THIS SOFTWARE.
15+
16+
name: CI
17+
18+
on:
19+
push:
20+
release:
21+
types: [published]
22+
23+
jobs:
24+
build:
25+
strategy:
26+
matrix:
27+
os: [ ubuntu-latest, windows-latest, macos-latest ]
28+
# The versions should contain (at least) the lowest requirement
29+
# and a version that is more up to date.
30+
toit-version: [ v2.0.0-alpha.120, latest ]
31+
include:
32+
- toit-version: v2.0.0-alpha.120
33+
version-name: old
34+
- toit-version: latest
35+
version-name: new
36+
37+
name: CI - ${{ matrix.os }} - ${{ matrix.version-name }}
38+
39+
runs-on: ${{ matrix.os }}
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- uses: toitlang/action-setup@v1
45+
with:
46+
toit-version: ${{ matrix.toit-version }}
47+
48+
- name: Test
49+
run: |
50+
make test

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Zero-Clause BSD License
2+
3+
# Copyright (C) 2024 Toitware ApS.
4+
5+
# Permission to use, copy, modify, and/or distribute this software for any
6+
# purpose with or without fee is hereby granted.
7+
8+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9+
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
10+
# FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11+
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12+
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13+
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14+
# PERFORMANCE OF THIS SOFTWARE.
15+
16+
name: Publish package
17+
on:
18+
push:
19+
tags:
20+
- 'v[0-9]+.[0-9]+.[0-9]+'
21+
- 'v[0-9]+.[0-9]+.[0-9]+-*'
22+
jobs:
23+
create-release:
24+
name: Create new release
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Publish
28+
uses: toitlang/[email protected]

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.packages/
2+
/build/

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (C) 2022 Toitware ApS.
2+
# Use of this source code is governed by a Zero-Clause BSD license that can
3+
# be found in the tests/LICENSE file.
4+
5+
cmake_minimum_required(VERSION 3.23)
6+
7+
project(desktop NONE)
8+
9+
enable_testing()
10+
add_subdirectory(tests)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Toit language
3+
Copyright (c) 2023 Toitware ApS
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright (C) 2023 Toitware ApS.
2+
# Use of this source code is governed by a Zero-Clause BSD license that can
3+
# be found in the tests/LICENSE file.
4+
5+
all: test
6+
7+
.PHONY: build/CMakeCache.txt
8+
build/CMakeCache.txt:
9+
$(MAKE) rebuild-cmake
10+
11+
install-pkgs: rebuild-cmake
12+
cmake --build build --target install-pkgs
13+
14+
test: install-pkgs rebuild-cmake
15+
cmake --build build --target check
16+
17+
# We rebuild the cmake file all the time.
18+
# We use "glob" in the cmakefile, and wouldn't otherwise notice if a new
19+
# file (for example a test) was added or removed.
20+
# It takes <1s on Linux to run cmake, so it doesn't hurt to run it frequently.
21+
rebuild-cmake:
22+
mkdir -p build
23+
# We need to set a build type, otherwise cmake won't run nicely on Windows.
24+
# The build-type is otherwise unused.
25+
cmake -B build -DCMAKE_BUILD_TYPE=Debug
26+
27+
.PHONY: all test rebuild-cmake install-pkgs

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1-
# pkg-xdg
2-
Package for XDG (Cross-Desktop Group) functionality
1+
# Desktop
2+
3+
A Toit package for cross-platform desktop functionality.
4+
5+
## References
6+
7+
- [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)
8+
9+
## Features and bugs
10+
11+
Please file feature requests and bugs at the [issue tracker][tracker].
12+
13+
[tracker]: https://github.com/toitlang/pkg-desktop/issues

package.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sdk: ^2.0.0-alpha.120
2+
prefixes:
3+
host: pkg-host
4+
packages:
5+
pkg-host:
6+
url: github.com/toitlang/pkg-host
7+
name: host
8+
version: 1.11.0
9+
hash: 7e7df6ac70d98a02f232185add81a06cec0d77e8

package.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: desktop
2+
description: Cross platform functionality, based on XDG (Cross-Desktop Group) specifications.
3+
environment:
4+
sdk: ^2.0.0-alpha.120
5+
dependencies:
6+
host:
7+
url: github.com/toitlang/pkg-host
8+
version: ^1.11.0

0 commit comments

Comments
 (0)