From 0738c7957e971b84a2a156d297596206b948c4f6 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Tue, 30 Aug 2022 12:04:28 +0100 Subject: [PATCH 1/3] use SQLCipher (#1) * rename to sqlcipher-simple, use direct-sqlcipher * cabal.project * update direct-sqlcipher * use local direct-sqlcipher * use direct-sqlcipher from git * update direct-sqlcipher commit --- .gitignore | 1 + cabal.project | 7 +++++++ sqlite-simple.cabal => sqlcipher-simple.cabal | 20 +++++++++---------- stack.yaml | 7 +++++-- 4 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 cabal.project rename sqlite-simple.cabal => sqlcipher-simple.cabal (81%) diff --git a/.gitignore b/.gitignore index 5ce26b9..9722583 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ TAGS /hpc_*.html /test.tix .stack-work/ +dist-newstyle/ diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..e131a96 --- /dev/null +++ b/cabal.project @@ -0,0 +1,7 @@ +packages: . +-- packages: . ../direct-sqlcipher + +source-repository-package + type: git + location: https://github.com/simplex-chat/direct-sqlcipher.git + tag: 477955063df65a2776c2a958b656ff359b76374d diff --git a/sqlite-simple.cabal b/sqlcipher-simple.cabal similarity index 81% rename from sqlite-simple.cabal rename to sqlcipher-simple.cabal index 30ea3a3..fd685b5 100644 --- a/sqlite-simple.cabal +++ b/sqlcipher-simple.cabal @@ -1,23 +1,23 @@ -Name: sqlite-simple +Name: sqlcipher-simple Version: 0.4.18.1 Synopsis: Mid-Level SQLite client library Description: - Mid-level SQLite client library, based on postgresql-simple. + Mid-level SQLCipher client library, forked from sqlite-simple. . Main documentation (with examples): . - You can view the project page at + You can view the project page at for more information. License: BSD3 License-file: LICENSE Author: Bryan O'Sullivan, Leon P Smith, Janne Hellsten -Maintainer: Janne Hellsten +Maintainer: Evgeny Poberezkin Copyright: (c) 2011 MailRank, Inc., (c) 2011-2012 Leon P Smith, (c) 2012-2014 Janne Hellsten -Homepage: http://github.com/nurpax/sqlite-simple -bug-reports: http://github.com/nurpax/sqlite-simple/issues +Homepage: https://github.com/simplex-chat/sqlcipher-simple +bug-reports: https://github.com/simplex-chat/sqlcipher-simple/issues Stability: stable Category: Database Build-type: Simple @@ -50,7 +50,7 @@ Library blaze-textual, bytestring >= 0.9, containers, - direct-sqlite >= 2.3.13 && < 2.4, + direct-sqlcipher >= 2.3.13 && < 2.4, exceptions >= 0.4, template-haskell, text >= 0.11, @@ -72,7 +72,7 @@ Library source-repository head type: git - location: http://github.com/nurpax/sqlite-simple + location: http://github.com/simplex-chat/sqlcipher-simple test-suite test @@ -107,7 +107,7 @@ test-suite test , base16-bytestring , bytestring >= 0.9 , HUnit - , sqlite-simple - , direct-sqlite + , sqlcipher-simple + , direct-sqlcipher , text , time diff --git a/stack.yaml b/stack.yaml index f527822..6c9ec98 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-15.1 # 8.8.2 - base-4.13 +resolver: lts-15.1 # 8.8.2 - base-4.13 # resolver: lts-14.27 # 8.6.5 - base-4.12 # resolver: lts-12.26 # 8.4.4 - base-4.11 # resolver: lts-11.22 # 8.2.2 - base-4.10 @@ -6,4 +6,7 @@ resolver: lts-15.1 # 8.8.2 - base-4.13 # resolver: lts-6.35 # 7.10.3 - base-4.8 extra-deps: - - direct-sqlite-2.3.26 + # - direct-sqlcipher-2.3.26 + # - ../direct-sqlcipher + - github: simplex-chat/direct-sqlcipher + commit: 477955063df65a2776c2a958b656ff359b76374d From 5e154a2aeccc33ead6c243ec07195ab673137221 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Tue, 30 Aug 2022 14:16:15 +0100 Subject: [PATCH 2/3] update direct-sqlcipher --- cabal.project | 2 +- stack.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cabal.project b/cabal.project index e131a96..dcdf91d 100644 --- a/cabal.project +++ b/cabal.project @@ -4,4 +4,4 @@ packages: . source-repository-package type: git location: https://github.com/simplex-chat/direct-sqlcipher.git - tag: 477955063df65a2776c2a958b656ff359b76374d + tag: 34309410eb2069b029b8fc1872deb1e0db123294 diff --git a/stack.yaml b/stack.yaml index 6c9ec98..a482ea3 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,4 +9,4 @@ extra-deps: # - direct-sqlcipher-2.3.26 # - ../direct-sqlcipher - github: simplex-chat/direct-sqlcipher - commit: 477955063df65a2776c2a958b656ff359b76374d + commit: 34309410eb2069b029b8fc1872deb1e0db123294 From 2b8c18c811f41d5703a2498b2703f81d6565bb28 Mon Sep 17 00:00:00 2001 From: "Evgeny @ SimpleX Chat" <259188159+evgeny-simplex@users.noreply.github.com> Date: Thu, 19 Nov 2026 21:49:55 +0000 Subject: [PATCH 3/3] ci: haskell-ci workflow for sqlcipher-simple (#3) --- .github/workflows/haskell-ci.yml | 230 +++++++++++++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 .github/workflows/haskell-ci.yml diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml new file mode 100644 index 0000000..d17436d --- /dev/null +++ b/.github/workflows/haskell-ci.yml @@ -0,0 +1,230 @@ +# This GitHub workflow config has been generated by a script via +# +# haskell-ci '--distribution' 'noble' 'github' 'sqlcipher-simple.cabal' +# +# To regenerate the script (for example after adjusting tested-with) run +# +# haskell-ci regenerate +# +# For more information, see https://github.com/haskell-CI/haskell-ci +# +# version: 0.19.20250506 +# +# REGENDATA ("0.19.20250506",["--distribution","noble","github","sqlcipher-simple.cabal"]) +# +name: Haskell-CI +on: + - push + - pull_request +jobs: + linux: + name: Haskell-CI - Linux - ${{ matrix.compiler }} + runs-on: ubuntu-24.04 + timeout-minutes: + 60 + container: + image: buildpack-deps:noble + continue-on-error: ${{ matrix.allow-failure }} + strategy: + matrix: + include: + - compiler: ghc-9.10.3 + compilerKind: ghc + compilerVersion: 9.10.3 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.8.4 + compilerKind: ghc + compilerVersion: 9.8.4 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.6.7 + compilerKind: ghc + compilerVersion: 9.6.7 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.4.8 + compilerKind: ghc + compilerVersion: 9.4.8 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.2.8 + compilerKind: ghc + compilerVersion: 9.2.8 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.0.2 + compilerKind: ghc + compilerVersion: 9.0.2 + setup-method: ghcup + allow-failure: false + - compiler: ghc-8.10.7 + compilerKind: ghc + compilerVersion: 8.10.7 + setup-method: ghcup + allow-failure: false + fail-fast: false + steps: + - name: apt-get install + run: | + apt-get update + apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo6 + - name: Install GHCup + run: | + mkdir -p "$HOME/.ghcup/bin" + curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup" + chmod a+x "$HOME/.ghcup/bin/ghcup" + - name: Install cabal-install + run: | + "$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' + run: | + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") + HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') + HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" + echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" + HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') + echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" + echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" + echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" + echo "HEADHACKAGE=false" >> "$GITHUB_ENV" + echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: env + run: | + env + - name: write cabal config + run: | + mkdir -p $CABAL_DIR + cat >> $CABAL_CONFIG <> $CABAL_CONFIG < cabal-plan.xz + echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c - + xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan + rm -f cabal-plan.xz + chmod a+x $HOME/.cabal/bin/cabal-plan + cabal-plan --version + - name: checkout + uses: actions/checkout@v4 + with: + path: source + - name: initial cabal.project for sdist + run: | + touch cabal.project + echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project + cat cabal.project + - name: sdist + run: | + mkdir -p sdist + $CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist + - name: unpack + run: | + mkdir -p unpacked + find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \; + - name: generate cabal.project + run: | + PKGDIR_sqlcipher_simple="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/sqlcipher-simple-[0-9.]*')" + echo "PKGDIR_sqlcipher_simple=${PKGDIR_sqlcipher_simple}" >> "$GITHUB_ENV" + rm -f cabal.project cabal.project.local + touch cabal.project + touch cabal.project.local + echo "packages: ${PKGDIR_sqlcipher_simple}" >> cabal.project + echo "package sqlcipher-simple" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project + cat >> cabal.project <> cabal.project.local + cat cabal.project + cat cabal.project.local + - name: dump install plan + run: | + $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all + cabal-plan + - name: restore cache + uses: actions/cache/restore@v4 + with: + key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} + path: ~/.cabal/store + restore-keys: ${{ runner.os }}-${{ matrix.compiler }}- + - name: install dependencies + run: | + $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all + $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all + - name: build w/o tests + run: | + $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all + - name: build + run: | + $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always + - name: tests + run: | + $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct + - name: cabal check + run: | + cd ${PKGDIR_sqlcipher_simple} || false + ${CABAL} -vnormal check + - name: haddock + run: | + $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all + - name: unconstrained build + run: | + rm -f cabal.project.local + $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all + - name: save cache + if: always() + uses: actions/cache/save@v4 + with: + key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} + path: ~/.cabal/store