~mrms/umka-file-dialog

de692f859e23090d8ac53753efcd6c3feca3e535 — Marek Maškarinec 10 months ago 1615f9c
add pak.json
9 files changed, 60 insertions(+), 25 deletions(-)

A .build.yml
M .gitignore
M README.md
D build
A build.sh
D dialog_linux.umi
D dialog_windows.umi
A pak.json
D wbuild
A .build.yml => .build.yml +28 -0
@@ 0,0 1,28 @@
image: debian/bullseye
packages:
- python3
- python3-pip
- mingw-w64
sources:
- https://git.sr.ht/~mrms/umka-file-dialog
- https://git.sr.ht/~mrms/pak
environment:
  project: file_dialog
secrets:
- 9e661366-b6d8-479a-aebb-5b06345da7cb
shell: false
tasks:
- setup: |
    cd pak
    python3 -m pip install -r requirements.txt
    ./setup.py install --user
- build: |
    cd umka-file-dialog
    python3 -m pak update
    python3 -m pak build
- deploy: |
    cd umka-file-dialog
    set +x
    python3 -m pak upload -t `cat ../.secret` pak.tar
    python3 -m pak upload -t `cat ../.secret` pak.json
    set -x

M .gitignore => .gitignore +3 -0
@@ 1,2 1,5 @@
*.o
umka_api.h
pak/
pak.tar
*.umi

M README.md => README.md +0 -18
@@ 1,21 1,3 @@
# umka file dialog

Opens a native file dialog on windows and linux. For usage see `test.um`.

You can download it [here](https://mrms.cz/dl/umka-file-dialog.zip).

## build

On linux run:

```
./build
```

For windows:

```
./wbuild
```

In WSL, or just make your own compile command.

D build => build +0 -4
@@ 1,4 0,0 @@
#!/bin/sh

cc -fpic -c dialog.c
cc -shared -o dialog_linux.umi dialog.o

A build.sh => build.sh +11 -0
@@ 0,0 1,11 @@
#!/bin/sh

for f in *.c; do
	echo CC $f
	BASENAME=`echo $f | cut -d. -f1`
	cc -fpic -shared -o ${BASENAME}_linux.umi $f \
		-Ipak/umka
	x86_64-w64-mingw32-gcc -shared -o ${BASENAME}_windows.umi $f \
		-Ipak/umka \
		-lcomdlg32
done

D dialog_linux.umi => dialog_linux.umi +0 -0
D dialog_windows.umi => dialog_windows.umi +0 -0
A pak.json => pak.json +18 -0
@@ 0,0 1,18 @@
{
    "name": "file_dialog",
    "version": "v0.1.0",
    "author": "Marek Maškarinec",
    "license": "unlicense",
    "description": "Native file dialog library",
    "readme": "README.md",
    "link": "https://git.sr.ht/~mrms/umka-file-dialog",
    "dependencies": ["umka"],
    "include": [
        "dialog.um",
        "dialog_linux.umi",
        "dialog_windows.umi"
    ],
    "run_posix": "./pak/umka/linux/umka test.um",
    "run_windows": ".\\pak\\umka\\windows\\umka.exe test.um",
    "pre_build": "sh build.sh"
}

D wbuild => wbuild +0 -3
@@ 1,3 0,0 @@
#!/bin/sh

x86_64-w64-mingw32-gcc -shared -o dialog_windows.umi dialog.c -lcomdlg32