Conversation
|
Also read |
1a4960a to
be1e1ef
Compare
|
Thank you for review. A have applied your suggestions. |
9a52a36 to
2d8eaba
Compare
|
Sorry, I forgot this PR. I've pushed a commit to your branch, please see if it works. |
|
Don't know if that means you don't like the solution or you didn't read it. Anyway the patch is here: diff --git a/pkgs/by-name/g-/g-golf-adw-1-examples/package.nix b/pkgs/by-name/g-/g-golf-adw-1-examples/package.nix
deleted file mode 100644
index 77c90a6e4c07..000000000000
--- a/pkgs/by-name/g-/g-golf-adw-1-examples/package.nix
+++ /dev/null
@@ -1,68 +0,0 @@
-{
- stdenv,
- lib,
- fetchurl,
- makeWrapper,
- wrapGAppsHook4,
- pkg-config,
- guile,
- guile-cairo,
- glib,
- gobject-introspection,
- libadwaita,
- callPackage,
- g-golf,
- texinfo,
-}:
-stdenv.mkDerivation (finalAttrs: {
-
- inherit (g-golf) version src;
-
- pname = "g-golf-adw-1-examples";
-
- nativeBuildInputs = [
- pkg-config
- texinfo
- makeWrapper
- wrapGAppsHook4
- glib
- ];
-
- buildInputs = [
- guile
- g-golf
- guile-cairo
- gobject-introspection
- libadwaita
- ];
-
- sourceRoot = "g-golf-${finalAttrs.version}/examples/adw-1/demo";
-
- postBuild = ''
- glib-compile-resources --target g-resources g-resources.xml
- '';
-
- installPhase = ''
- mkdir -p $out/bin $out/share/doc/g-golf/examples
- cp -rf .. $out/share/doc/g-golf/examples/
-
- find $out/share -type f -executable | while read file; do
- name=g-golf-adw-1-$(basename $file)
- makeWrapper $file $out/bin/$name \
- --chdir $(dirname $file) \
- --prefix PATH : "${guile}/bin" \
- --prefix GUILE_LOAD_PATH : "$GUILE_LOAD_PATH" \
- --prefix GUILE_LOAD_COMPILED_PATH : "$GUILE_LOAD_COMPILED_PATH" \
- --prefix LD_LIBRARY_PATH : "${g-golf}/lib:${guile-cairo}/lib" \
- --set GUILE_AUTO_COMPILE 0
- done
- '';
-
- meta = {
- description = "G-Golf adwaita-1 examples";
- homepage = "https://www.gnu.org/software/g-golf/";
- license = lib.licenses.lgpl3Plus;
- maintainers = with lib.maintainers; [ mobid ];
- platforms = lib.platforms.unix;
- };
-})
diff --git a/pkgs/by-name/g-/g-golf-gtk-4-examples/package.nix b/pkgs/by-name/g-/g-golf-gtk-4-examples/package.nix
index f926933eebdb..bf6968a91180 100644
--- a/pkgs/by-name/g-/g-golf-gtk-4-examples/package.nix
+++ b/pkgs/by-name/g-/g-golf-gtk-4-examples/package.nix
@@ -1,7 +1,6 @@
{
- stdenv,
lib,
- fetchurl,
+ stdenv,
makeWrapper,
wrapGAppsHook4,
pkg-config,
@@ -12,15 +11,20 @@
gtk4,
which,
adwaita-icon-theme,
- callPackage,
+ libadwaita,
g-golf,
texinfo,
+ g-golf-adw-1-examples,
+ useLibadwaita ? false,
}:
+
stdenv.mkDerivation (finalAttrs: {
inherit (g-golf) version src;
- pname = "g-golf-gtk-4-examples";
+ pname = "g-golf-${finalAttrs.variant}-examples";
+
+ variant = if useLibadwaita then "adw-1" else "gtk-4";
nativeBuildInputs = [
pkg-config
@@ -38,16 +42,18 @@ stdenv.mkDerivation (finalAttrs: {
gobject-introspection
gtk4
adwaita-icon-theme
- ];
+ ] ++ lib.optionals useLibadwaita [ libadwaita ];
- sourceRoot = "g-golf-${finalAttrs.version}/examples/gtk-4/demos";
+ sourceRoot = "g-golf-${finalAttrs.version}/examples/${finalAttrs.variant}/demos";
installPhase = ''
+ runHook preInstall
+
mkdir -p $out/bin $out/share/doc/g-golf/examples
cp -rf .. $out/share/doc/g-golf/examples/
find $out/share -type f -executable | while read file; do
- name=g-golf-gtk-4-$(basename $file)
+ name=g-golf-${finalAttrs.variant}-$(basename $file)
makeWrapper $file $out/bin/$name \
--chdir $(dirname $file) \
--prefix PATH : "${guile}/bin" \
@@ -56,10 +62,14 @@ stdenv.mkDerivation (finalAttrs: {
--prefix LD_LIBRARY_PATH : "${g-golf}/lib:${guile-cairo}/lib" \
--set GUILE_AUTO_COMPILE 0
done
+
+ runHook postInstall
'';
+ passthru.tests = { inherit g-golf-adw-1-examples; };
+
meta = {
- description = "G-Golf gtk-4 examples";
+ description = "G-Golf ${finalAttrs.variant} examples";
homepage = "https://www.gnu.org/software/g-golf/";
license = lib.licenses.lgpl3Plus;
maintainers = with lib.maintainers; [ mobid ];
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index d196b6c1f469..34385faed8fd 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3028,6 +3028,10 @@ with pkgs;
uniscribe = callPackage ../tools/text/uniscribe { };
+ g-golf-adw-1-examples = callPackage ../by-name/g-/g-golf-gtk-4-examples/package.nix {
+ useLibadwaita = true;
+ };
+
gandi-cli = python3Packages.callPackage ../tools/networking/gandi-cli { };
gaphor = python3Packages.callPackage ../tools/misc/gaphor { }; |
|
Sorry, I force-pushed before saw your commit. |
|
@ofborg build g-golf-gtk-4-examples g-golf-adw-1-examples |
g-golf-gtk-4-animated-paintableg-golf-gtk-4-clipboardmissing icon: g-golf-gtk-4-peg-solitaireCan't interact with? I don't know how to use it tbf g-golf-gtk-4-simple-paintable |
|
For peg-solitaire and clipboard is this correct behaviour. I will ask package maintainer for sure. About other two: I forget that g-golf (if you use cairo) need last version of guile-cairo [1] to work. I have this version in overlay so it was working for me: guile-cairo.overrideAttrs (s: {
src = fetchgit {
url = "https://git.savannah.gnu.org/git/guile-cairo.git";
rev = "fa2ff12e5e01966d5dcd8cfb7d5f29324b814223";
hash = "sha256-yrI4VjMSFVvtxtY+JLrDXAYfCUAM3UkAFBSW5p8F5g8=";
};
nativeBuildInputs = [ autoconf automake texinfo ]
++ s.nativeBuildInputs;
preConfigure = ''
autoreconf -fvi
'';
})How can we deal with this. Can I put last version into [1] https://cgit.git.savannah.gnu.org/cgit/guile-cairo.git/ (last few commits are needed) |
It's a drag and drop example. |
|
@Aleksanaa Check the last commit, WDYT? |
|
See #421201 |
Ok. I copy package. It will become deprecated when new version of guile-cairo will be released. |
| sed -i 's|libgirepository-1.0|${gobject-introspection}/lib/libgirepository-1.0.so|' g-golf/init.scm | ||
| sed -i "s|libglib-2.0|${glib.out}/lib/libglib-2.0.so|" g-golf/init.scm | ||
| sed -i "s|libgobject-2.0|${glib.out}/lib/libgobject-2.0.so|" g-golf/init.scm |
There was a problem hiding this comment.
I was able to get the equivalent working with
env.LD_LIBRARY_PATH = lib.makeLibraryPath [
gobject-introspection
glib
];If you also want to support cross-compilation, these libraries probably need to be retrieved from buildPackages.
There was a problem hiding this comment.
If I do this, the examples stop working.
There was a problem hiding this comment.
It looks like the way this is supposed to work is with GUILE_EXTENSIONS_PATH.
But since this needs to be propagated (as you found by the broken examples), this would probably need to be added to the guile package itself, and then have this package use propagatedBuildInputs to make dependencies available downstream.
Not sure who maintains this interpreter though.
|
@Aleksanaa Is now ok? |
pkgs/by-name/g-/g-golf/package.nix
Outdated
| pkg-config | ||
| libtool | ||
| gnumake | ||
| gcc |
|
Can we merge this PR, or is there anything else I should do? |
| doCheck = false; # Cannot find unit-test module from guile-lib | ||
| nativeCheckInputs = [ guile-lib ]; | ||
|
|
||
| meta = with lib; { |
There was a problem hiding this comment.
Remove with lib. This is considered a harmful pattern and has been removed in tree.
|
|
||
| stdenv.mkDerivation { | ||
| pname = "guile-cairo-next"; | ||
| version = "1.11.2-next"; |
There was a problem hiding this comment.
Please check versioning scheme: https://github.com/NixOS/nixpkgs/tree/master/pkgs#versioning
0d18bd6 to
98c8645
Compare

Guile library for GTK.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.