Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a3c25a2
initial manual scaffolding of deps etc.
georgefst Mar 30, 2026
0a88fa6
git-ignore
georgefst Mar 30, 2026
dec0884
initial vibey attempt to replace c2hs with hs-bindgen
georgefst Mar 30, 2026
962fb09
use uinput finalizer
georgefst Mar 30, 2026
48b8085
fix examples etc. by using correct enum conversions
georgefst Mar 30, 2026
f2dd915
refactor to avoid hardcoding numbers
georgefst Mar 30, 2026
b3fcd87
remove unused function
georgefst Mar 31, 2026
91532e7
minimise TH paths
georgefst Mar 31, 2026
ca56856
simplify header
georgefst Mar 31, 2026
df3b053
format
georgefst Mar 31, 2026
e425869
simplify internal imports
georgefst Mar 31, 2026
93f095b
temporarily expose modules in order to get haddocks for generated code
georgefst Mar 31, 2026
a2d354d
simplify enums, incl. dropping weird and unnecessary Enum instances t…
georgefst Mar 31, 2026
b29ccf1
update CI versions (should just use Nix now really...)
georgefst Mar 31, 2026
ae18f0f
remove pointless const pointer conversion helpers
georgefst Mar 31, 2026
432b6f3
simplify getAbsInfo
georgefst Mar 31, 2026
50411cb
simplify uinput device construction
georgefst Mar 31, 2026
4bd4c7f
simplify event types
georgefst Mar 31, 2026
aeaedb1
attempt to nixify CI
georgefst Mar 31, 2026
658a065
further simplify absinfo and uinput construction, fixing malloc memor…
georgefst Mar 31, 2026
75eeeb9
try cachix for CI
georgefst Mar 31, 2026
c7884cc
add iog keys
georgefst Mar 31, 2026
b81851b
add unofficial iog keys
georgefst Mar 31, 2026
9184960
further simplify uinput creation, and avoid potential access to unini…
georgefst Mar 31, 2026
92cffd9
remove pointless low-level opaque device types
georgefst Mar 31, 2026
dea82a4
minor refactors
georgefst Mar 31, 2026
7a9a19e
inline uinput functions and start simplifying utils
georgefst Mar 31, 2026
aca489f
inline the rest of LowLevel
georgefst Mar 31, 2026
2cb4e95
rename local foreign import
georgefst Mar 31, 2026
ea6577a
use type synonym
georgefst Mar 31, 2026
c461c2f
rename foreign import
georgefst Mar 31, 2026
f2671b2
restore exact c2hs codes output
georgefst Mar 31, 2026
2742037
Revert "restore exact c2hs codes output"
georgefst Mar 31, 2026
bf86b3c
use type synonym
georgefst Mar 31, 2026
299cd2b
fix EvRep pointer type
georgefst Mar 31, 2026
3315757
more temporary exposition
georgefst Mar 31, 2026
3aba5a7
add sanity check for key list length
georgefst Mar 31, 2026
b570210
code/enum improvements - note vibey Generator.hs
georgefst Apr 1, 2026
556eb16
simplify codes generator a bit
georgefst Apr 1, 2026
91ba348
avoid head
georgefst Apr 1, 2026
d169f8c
clean up code generation more - generateCodes and the parsing stuff a…
georgefst Apr 1, 2026
9df7617
use category choice to avoid manual funptr import
georgefst Apr 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 16 additions & 43 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,24 @@ jobs:
name: main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set user input permissions
run: sudo usermod -a -G input $USER

- name: Set up GHC
uses: haskell-actions/setup@v2
id: setup
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
with:
ghc-version: '9.4'
cabal-version: '3.10'
cabal-update: true

- name: Install libevdev
run: sudo apt install -y libevdev-dev

- name: Configure the build
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build all --dry-run

- name: Restore cached dependencies
uses: actions/cache/restore@v3
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
extra-substituters = https://cache.iog.io https://cache.zw3rk.com
extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk=
- uses: cachix/cachix-action@v15
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-

- name: Install dependencies
run: cabal build all --only-dependencies
name: georgefst
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Save cached dependencies
uses: actions/cache/save@v3
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: Build all packages
run: nix build .#ci

- name: Build
run: cabal build all
# TODO work around test permissions and ARM build and
# - name: Run checks
# run: nix flake check

- name: Run tests
run: |
cabal build test
sudo $(cabal list-bin test)
- name: Run main test with permissions
run: sudo $(nix build .#evdev:test:test --print-out-paths)/bin/test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist-newstyle
.ghc.environment.*
cabal.project.local
result
evdev/output
12 changes: 12 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ packages:
evdev-streamly
evdev-examples

source-repository-package
type: git
location: https://github.com/well-typed/hs-bindgen
tag: 3c4af10590d0d09e825a9735e9a03d7f60914e21
subdir: c-expr-dsl c-expr-runtime hs-bindgen hs-bindgen-runtime
--sha256: UCA7w+u20+CX1XN8so76UfJkM0FKKpljOgweP2FjtS4=
source-repository-package
type: git
location: https://github.com/well-typed/libclang
tag: 1054474fae403bfb52c7919680cac03d3d3d4237
--sha256: LTAyNMY4Vu0vPeEq2wXB0KWY4kGtqtHTRmADjLdkv78=

if impl(ghc >= 9.10)
allow-newer:
-- deprecated - we'll replace it ASAP in favour of `OsPath`
Expand Down
11 changes: 7 additions & 4 deletions evdev/evdev.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ common common
containers ^>= {0.6.2, 0.7, 0.8},
extra ^>= {1.6.18, 1.7, 1.8},
filepath-bytestring ^>= {1.4.2, 1.5},
hs-bindgen ^>= {0.1},
hs-bindgen-runtime ^>= {0.1},
monad-loops ^>= 0.4.3,
mtl ^>= {2.2, 2.3},
rawfilepath ^>= {1.0, 1.1},
template-haskell ^>= {2.21, 2.22, 2.23},
th-compat ^>= 0.1.7,
time ^>= {1.9.3, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15},
unix ^>= 2.8,
default-language: GHC2021
Expand All @@ -48,16 +52,15 @@ library
Evdev
Evdev.Codes
Evdev.Uinput
other-modules:
Evdev.LowLevel
Evdev.Raw
Util
other-modules:
Evdev.Codes.Generator
hs-source-dirs: src
c-sources:
src-c/evdev-hs.c
pkgconfig-depends:
libevdev
build-tool-depends:
c2hs:c2hs

test-suite test
import: common
Expand Down
Loading
Loading