6 Commits

Author SHA1 Message Date
03f6a67a0a fcitx5-toki-pona: use fork w/ icons 2026-03-11 18:34:34 -06:00
12a5095325 fcitx5-toki-pona: init 2026-03-11 13:43:32 -06:00
53bf019e26 gf-core: pin compiler version
Some checks failed
Build and populate cache / tests (sydpkgs, nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz, sydpkgs) (push) Has been cancelled
2026-02-16 20:44:32 -07:00
e190dae46b gftest: init
Some checks failed
Build and populate cache / tests (sydpkgs, nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz, sydpkgs) (push) Has been cancelled
2026-02-16 02:30:36 -07:00
d3252333eb gfWithPackages: init
Some checks failed
Build and populate cache / tests (sydpkgs, nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz, sydpkgs) (push) Has been cancelled
2026-02-15 21:01:13 -07:00
2d0874fd1d gf-rgl: init 2026-02-15 20:45:55 -07:00
8 changed files with 174 additions and 19 deletions

View File

@@ -0,0 +1,41 @@
{ stdenv
, fetchFromGitHub
, kdePackages
, python3
, libime
, lib
}:
stdenv.mkDerivation {
pname = "fcitx5-toki-pona";
version = "git";
src = fetchFromGitHub {
owner = "msyds";
repo = "fcitx5-toki-pona";
rev = "4b4314d642c647bc714c8876460b6779facda89c";
# rev = "icons";
hash = "sha256-5Keg+7AYkELYAlJkPszcjHgJ6TwBxnwNd3cpxSOEbGc=";
};
# src = /home/msyds/git/fcitx5-toki-pona;
buildInputs = [
kdePackages.fcitx5-chinese-addons
];
nativeBuildInputs = [
python3
libime
];
buildPhase = ''
runHook preBuild
python3 combine.py
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm644 -t $out/share/fcitx5/table table/*
install -Dm644 -t $out/share/fcitx5/inputmethod confs/*
find icons -name '*.png' -exec install -Dm644 {} "$out/share/{}" \;
runHook postInstall
'';
}

View File

@@ -1,32 +1,30 @@
{ haskell
, haskellPackages
, stdenv
, fetchFromGitHub
, autoreconfHook
, gf-pgf
, applyPatches
, compiler ? "ghc98"
}:
let
version = "3.12";
src = fetchFromGitHub {
owner = "GrammaticalFramework";
repo = "gf-core";
rev = "release-${version}";
hash = "sha256-9sB8tt2eOJT43kv2eaUYRQCzyBZOp6HvJdgGJQgiqks=";
};
pkg = haskellPackages.callCabal2nixWithOptions "gf" src "--flag=-server" {};
gf-pgf = stdenv.mkDerivation {
pname = "gf-pgf";
version = "0.0.1";
src = "${src}/src/runtime/c";
nativeBuildInputs = [ autoreconfHook ];
src = applyPatches rec {
src = fetchFromGitHub {
owner = "GrammaticalFramework";
repo = "gf-core";
rev = "release-${version}";
hash = "sha256-9sB8tt2eOJT43kv2eaUYRQCzyBZOp6HvJdgGJQgiqks=";
};
patches = [
"${src}/nix/expose-all.patch"
"${src}/nix/revert-new-cabal-madness.patch"
./fix-cabal-syntax-error.patch
];
};
hpkgs = haskell.packages.${compiler};
pkg = hpkgs.callCabal2nixWithOptions "gf" src "--flag=-server" {};
in haskell.lib.overrideCabal pkg (prev: {
patches = [
"${src}/nix/expose-all.patch"
"${src}/nix/revert-new-cabal-madness.patch"
];
jailbreak = true;
configureFlags = [ "-f" "c-runtime" ];
librarySystemDepends = [ gf-pgf ];
passthru = { inherit gf-pgf; };
})

View File

@@ -0,0 +1,13 @@
diff --git a/src/runtime/haskell-bind/pgf2.cabal b/src/runtime/haskell-bind/pgf2.cabal
index d7a98489e..3ca7e816c 100644
--- a/src/runtime/haskell-bind/pgf2.cabal
+++ b/src/runtime/haskell-bind/pgf2.cabal
@@ -15,7 +15,7 @@ homepage: https://www.grammaticalframework.org/
bug-reports: https://github.com/GrammaticalFramework/gf-core/issues
author: Krasimir Angelov
extra-source-files: CHANGELOG.md, README.md
-tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.10.4, GHC=9.6.6
+tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.10.4, GHC==9.6.6
library
exposed-modules:

11
pkgs/gf-pgf/default.nix Normal file
View File

@@ -0,0 +1,11 @@
{ gf-core
, stdenv
, autoreconfHook
}:
stdenv.mkDerivation {
pname = "gf-pgf";
inherit (gf-core) version meta;
src = "${gf-core.src}/src/runtime/c";
nativeBuildInputs = [autoreconfHook ];
}

25
pkgs/gf-rgl/default.nix Normal file
View File

@@ -0,0 +1,25 @@
{ stdenv
, ghc
, gf-core
, fetchFromGitHub
}:
stdenv.mkDerivation (finalAttrs: {
name = "gf-rgl";
version = "20250812";
src = fetchFromGitHub {
owner = "GrammaticalFramework";
repo = "gf-rgl";
tag = finalAttrs.version;
hash = "sha256-rqN5MV/XxChXC+Vs4aLIhRtyPQZNk0LQZ2TCdbd6wUw=";
};
buildInputs = [ ghc gf-core ];
LC_ALL = "C.UTF-8";
buildPhase = ''
runghc Setup.hs build
'';
installPhase = ''
mkdir -p $out/share/gf/lib
runghc Setup.hs copy --dest=$out/share/gf/lib
'';
})

View File

@@ -0,0 +1,22 @@
{ lib
, stdenv
, gf-core
, makeWrapper
, runCommandLocal
}:
packages:
let
opts = {
passthru = {
preferLocalBuild = true;
inherit (gf-core) version meta;
};
};
paths = lib.makeSearchPath "share/gf/lib" packages;
in runCommandLocal "gf-with-rgl" opts ''
. ${makeWrapper}/nix-support/setup-hook
makeWrapper ${gf-core}/bin/gf $out/bin/gf \
--prefix GF_LIB_PATH : ${paths}
''

26
pkgs/gftest/default.nix Normal file
View File

@@ -0,0 +1,26 @@
{ gf-core
, breakpointHook
, fetchFromGitHub
, compiler ? "ghc98"
, haskell
, pgf2-haskell
, gf-pgf
}:
let
src = fetchFromGitHub {
owner = "GrammaticalFramework";
repo = "gftest";
rev = "ef7c99143d84a29fb28bbc464f661566d44a6130";
hash = "sha256-t/LaG5+bdv7f0URcn/aFx6nUIvxSSEbpWeZS92/Gbog=";
};
hpkgs = haskell.packages.${compiler}.extend (final: prev: {
# PGF2, the Haskell bindings to the C library.
pgf2 = pgf2-haskell.override { inherit compiler; };
});
pkg = hpkgs.callCabal2nix "gftest" src {};
in pkg.overrideAttrs (final: prev: {
nativeBuildInputs = (prev.nativeBuildInputs or []) ++ [
breakpointHook
];
})

View File

@@ -0,0 +1,19 @@
{ haskell
, compiler ? "ghc96"
, gf-pgf
, gf-core
, breakpointHook
}:
let
src = "${gf-core.src}/src/runtime/haskell-bind";
hpkgs = haskell.packages.${compiler};
pkg = hpkgs.callCabal2nix "pgf2" src {
# gf-pgf provides both libpgf and libgu.
gu = gf-pgf;
};
in haskell.lib.overrideCabal pkg (prev: {
librarySystemDepends = (prev.librarySystemDepends or []) ++ [
gf-pgf
];
})