Changes
6 changed files (+174/-132)
-
-
@@ -30,3 +30,8 @@ [*.{zig,zon}]# Zig insists on 4 spaces, ignoring accessibility problems. indent_style = space indent_size = 4 [*.nix] # Nix's string interpolation has problem with tab character indent_style = space indent_size = 2
-
-
-
@@ -1,6 +1,10 @@# generated by zon2nix (https://github.com/nix-community/zon2nix) { linkFarm, fetchzip, fetchgit }: { linkFarm, fetchzip, fetchgit, }: linkFarm "zig-packages" [ {
-
-
-
@@ -16,15 +16,18 @@ # SPDX-License-Identifier: Apache-2.0{ stdenvNoCC }: stdenvNoCC.mkDerivation { pname = "plac"; version = "0.0.0"; src = ../.; pname = "plac"; version = "0.0.0"; src = ../.; phases = [ "unpackPhase" "installPhase" ]; installPhase = '' mkdir -p $out cp $src/build.zig $out cp $src/build.zig.zon $out cp -r $src/src $out ''; phases = [ "unpackPhase" "installPhase" ]; installPhase = '' mkdir -p $out cp $src/build.zig $out cp $src/build.zig.zon $out cp -r $src/src $out ''; }
-
-
-
@@ -22,6 +22,7 @@{ "excludes": ["LICENSES"], "lineWidth": 100, "indentWidth": 2, "newLineKind": "lf", "useTabs": true, "json": {},
-
@@ -40,6 +41,10 @@ },{ "exts": ["vala"], "command": "uncrustify -c uncrustify.cfg -l VALA", }, { "exts": ["nix"], "command": "nixfmt --strict --width={{line_width}} --indent={{indent_width}}", }, ], },
-
-
-
@@ -15,76 +15,87 @@ ## SPDX-License-Identifier: Apache-2.0 { description = "Plac monorepo"; description = "Plac monorepo"; inputs = { nixpkgs = { url = "github:nixos/nixpkgs/release-25.05"; }; inputs = { nixpkgs = { url = "github:nixos/nixpkgs/release-25.05"; }; flake-utils = { url = "github:numtide/flake-utils"; }; }; flake-utils = { url = "github:numtide/flake-utils"; }; }; outputs = { self, nixpkgs, flake-utils, }: flake-utils.lib.eachDefaultSystem ( system: let pkgs = nixpkgs.legacyPackages.${system}; lib = pkgs.lib; in rec { packages = { gtk-adwaita = pkgs.callPackage ./gtk-adwaita/nix/package.nix { }; outputs = { self , nixpkgs , flake-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; lib = pkgs.lib; in rec { packages = { gtk-adwaita = pkgs.callPackage ./gtk-adwaita/nix/package.nix {}; update-deps = pkgs.writeShellApplication { name = "update-deps"; update-deps = pkgs.writeShellApplication { name = "update-deps"; text = '' cd core ${pkgs.zon2nix}/bin/zon2nix > nix/deps.nix ''; }; }; text = '' cd core ${pkgs.zon2nix}/bin/zon2nix > nix/deps.nix ''; }; }; devShell = pkgs.mkShell { buildInputs = [ (lib.lists.remove pkgs.zig.hook packages.gtk-adwaita.nativeBuildInputs) packages.gtk-adwaita.buildInputs ]; devShell = pkgs.mkShell { buildInputs = [ (lib.lists.remove pkgs.zig.hook packages.gtk-adwaita.nativeBuildInputs) packages.gtk-adwaita.buildInputs ]; packages = with pkgs; [ # > Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA # https://uncrustify.sourceforge.net/ uncrustify packages = with pkgs; [ # > Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA # https://uncrustify.sourceforge.net/ uncrustify # For text editors, optional. # > ZLS is a non-official implementation of the Language Server Protocol for Zig # https://github.com/zigtools/zls zls # For text editors, optional. # > ZLS is a non-official implementation of the Language Server Protocol for Zig # https://github.com/zigtools/zls zls # For text editors, optional. # > Code Intelligence for Vala & Genie # https://github.com/vala-lang/vala-language-server vala-language-server # For text editors, optional. # > Code Intelligence for Vala & Genie # https://github.com/vala-lang/vala-language-server vala-language-server # Code formatter # https://dprint.dev/ dprint # Code formatter # https://dprint.dev/ dprint # Copyright and license linter based on SPDX # https://github.com/fsfe/reuse-tool reuse # Copyright and license linter based on SPDX # https://github.com/fsfe/reuse-tool reuse ] # Non macOS packages (not supported, broken, etc.) ++ (lib.optionals (!stdenv.isDarwin) [ # For debugging, optional. # > Valgrind is an instrumentation framework for building dynamic analysis tools # https://valgrind.org/ valgrind ]); }; }); # Official formatter for Nix code # https://hackage.haskell.org/package/nixfmt nixfmt-rfc-style ] # Non macOS packages (not supported, broken, etc.) ++ (lib.optionals (!stdenv.isDarwin) [ # For debugging, optional. # > Valgrind is an instrumentation framework for building dynamic analysis tools # https://valgrind.org/ valgrind ]); }; } ); }
-
-
-
@@ -14,79 +14,93 @@ # limitations under the License.# # SPDX-License-Identifier: Apache-2.0 { stdenvNoCC, callPackage, zig, gtk4, pkg-config, libjpeg, libadwaita, librsvg, libgee, vala, coreutils, wrapGAppsHook4 }: { stdenvNoCC, callPackage, zig, gtk4, pkg-config, libjpeg, libadwaita, librsvg, libgee, vala, coreutils, wrapGAppsHook4, }: stdenvNoCC.mkDerivation { pname = "plac-gtk-adwaita"; version = "0.0.0"; src = ../.; pname = "plac-gtk-adwaita"; version = "0.0.0"; src = ../.; meta = { mainProgram = "jp.pocka.plac.gtk-adwaita"; }; meta = { mainProgram = "jp.pocka.plac.gtk-adwaita"; }; nativeBuildInputs = [ zig.hook nativeBuildInputs = [ zig.hook # > Zig is a general-purpose programming language and toolchain for maintaining # > robust, optimal and reusable software. # https://ziglang.org/ zig # > Zig is a general-purpose programming language and toolchain for maintaining # > robust, optimal and reusable software. # https://ziglang.org/ zig # > pkg-config is a helper tool used when compiling applications and libraries. # https://www.freedesktop.org/wiki/Software/pkg-config/ pkg-config # > pkg-config is a helper tool used when compiling applications and libraries. # https://www.freedesktop.org/wiki/Software/pkg-config/ pkg-config # > Vala is a programming language using modern high level abstractions without # > imposing additional runtime requirements and without using a different ABI # > compared to applications and libraries written in C. # https://vala.dev/ vala # > Vala is a programming language using modern high level abstractions without # > imposing additional runtime requirements and without using a different ABI # > compared to applications and libraries written in C. # https://vala.dev/ vala # Installed for "realpath" command. coreutils ]; # Installed for "realpath" command. coreutils ]; buildInputs = [ # > The GTK toolkit # https://docs.gtk.org/gtk4/ gtk4 buildInputs = [ # > The GTK toolkit # https://docs.gtk.org/gtk4/ gtk4 # > Faster (using SIMD) libjpeg implementation # https://libjpeg-turbo.org/ libjpeg # > Faster (using SIMD) libjpeg implementation # https://libjpeg-turbo.org/ libjpeg # Provides styles and widgets following GNOME Human Interface Guideline. # (https://developer.gnome.org/hig/index.html) # > Building blocks for modern GNOME applications # https://gnome.pages.gitlab.gnome.org/libadwaita/ # https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/ # https://valadoc.org/libadwaita-1/index.htm libadwaita # Provides styles and widgets following GNOME Human Interface Guideline. # (https://developer.gnome.org/hig/index.html) # > Building blocks for modern GNOME applications # https://gnome.pages.gitlab.gnome.org/libadwaita/ # https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/ # https://valadoc.org/libadwaita-1/index.htm libadwaita # Required library for GTK4/Adwaita, albeit undocumented. # > A library to render SVG images to Cairo surfaces. # https://gitlab.gnome.org/GNOME/librsvg librsvg # Required library for GTK4/Adwaita, albeit undocumented. # > A library to render SVG images to Cairo surfaces. # https://gitlab.gnome.org/GNOME/librsvg librsvg # Necessary library to use collection types such as HashMap and ArrayList in Vala. # https://wiki.gnome.org/Projects/Libgee # https://valadoc.org/gee-0.8/index.htm libgee # Necessary library to use collection types such as HashMap and ArrayList in Vala. # https://wiki.gnome.org/Projects/Libgee # https://valadoc.org/gee-0.8/index.htm libgee # This helper takes care of GLib/GTK's messy runtime things. # https://nixos.org/manual/nixpkgs/stable/#sec-language-gnome wrapGAppsHook4 ]; # This helper takes care of GLib/GTK's messy runtime things. # https://nixos.org/manual/nixpkgs/stable/#sec-language-gnome wrapGAppsHook4 ]; zigBuildFlags = [ "--system" (callPackage ../../core/nix/deps.nix {}) "-Dcompile-gschema" ]; zigBuildFlags = [ "--system" (callPackage ../../core/nix/deps.nix { }) "-Dcompile-gschema" ]; # zon2nix does not support path dependency, and Zig seems not to have a way to set multiple # dependencies directory nor specify directory name via flags. postPatch = '' substituteInPlace build.zig.zon \ --replace "../core" $(realpath --relative-to=. ${callPackage ../../core/nix/package.nix {}}) ''; # zon2nix does not support path dependency, and Zig seems not to have a way to set multiple # dependencies directory nor specify directory name via flags. postPatch = '' substituteInPlace build.zig.zon \ --replace "../core" $(realpath --relative-to=. ${callPackage ../../core/nix/package.nix { }}) ''; }
-