mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 13:00:23 +00:00
To reproduce:
$ nix run nixpkgs/3b32825de172d0bc85664f495edb096b10862524#ast-grep \
-- scan --update-all --inline-rules '
id: nix-x86_64-darwin
language: nix
rule:
any:
- pattern: "\"x86_64-darwin\""
kind: list_expression > string_expression
- pattern:
context: "{ \"x86_64-darwin\" = $EXPR; }"
selector: binding
- pattern:
context: "{ x86_64-darwin = $EXPR; }"
selector: binding
fix:
template: ""
' pkgs
$ nix run nixpkgs/3b32825de172d0bc85664f495edb096b10862524#ast-grep \
-- scan --update-all --inline-rules '
id: json-first-x86_64-darwin
language: json
rule:
kind: object > pair:nth-child(1)
has:
pattern: "\"x86_64-darwin\""
field: key
fix:
template: ""
expandEnd: { regex: "," }
' pkgs
$ nix run nixpkgs/3b32825de172d0bc85664f495edb096b10862524#ast-grep \
-- scan --update-all --inline-rules '
id: json-x86_64-darwin
language: json
rule:
kind: object > pair
has:
pattern: "\"x86_64-darwin\""
field: key
fix:
template: ""
expandStart: { regex: "," }
' pkgs
$ git restore pkgs/by-name/om/omnix/package.nix
$ git diff --name-only -z \
| nix shell nixpkgs/3b32825de172d0bc85664f495edb096b10862524#gnused \
-c xargs -0 sed -i '/^$/N; /^\n\? \+$/d'
$ treefmt
121 lines
2.5 KiB
Nix
121 lines
2.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
pkg-config,
|
|
makeDesktopItem,
|
|
unzip,
|
|
fpc,
|
|
lazarus,
|
|
libx11,
|
|
glib,
|
|
gtk2,
|
|
gdk-pixbuf,
|
|
pango,
|
|
atk,
|
|
cairo,
|
|
openssl,
|
|
unstableGitUpdater,
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "transgui";
|
|
version = "5.18.0-unstable-2026-02-24";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "transmission-remote-gui";
|
|
repo = "transgui";
|
|
rev = "da71b860d4920f7ab847a48bd8d804725ddbad7b";
|
|
hash = "sha256-ZrzC0Pnf4HXC/XqOCzPfhAhfUvuchW2CgX3izfQAALo=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
unzip
|
|
];
|
|
buildInputs = [
|
|
fpc
|
|
lazarus
|
|
stdenv.cc
|
|
libx11
|
|
glib
|
|
gtk2
|
|
gdk-pixbuf
|
|
pango
|
|
atk
|
|
cairo
|
|
openssl
|
|
];
|
|
|
|
env.NIX_LDFLAGS = ''
|
|
-L${lib.getLib stdenv.cc.cc}/lib -lX11 -lglib-2.0 -lgtk-x11-2.0
|
|
-lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lpango-1.0 -latk-1.0 -lcairo
|
|
-lc -lcrypto
|
|
'';
|
|
|
|
postPatch = ''
|
|
substituteInPlace restranslator.pas --replace /usr/ $out/
|
|
|
|
# Fix build with lazarus 4.0, https://github.com/transmission-remote-gui/transgui/issues/1486
|
|
substituteInPlace main.pas --replace-warn "h <> INVALID_HANDLE_VALUE" "h >= 0"
|
|
'';
|
|
|
|
preBuild = ''
|
|
FPCDIR=${fpc}/lib/fpc/${fpc.version} fpcmake -w
|
|
lazbuild -B transgui.lpr --lazarusdir=${lazarus}/share/lazarus
|
|
'';
|
|
|
|
makeFlags = [
|
|
"FPC=fpc"
|
|
"PP=fpc"
|
|
"INSTALL_PREFIX=$(out)"
|
|
];
|
|
|
|
env.LCL_PLATFORM = "gtk2";
|
|
|
|
desktopItem = makeDesktopItem {
|
|
name = pname;
|
|
exec = "${pname} %U";
|
|
icon = pname;
|
|
type = "Application";
|
|
comment = meta.description;
|
|
desktopName = "Transmission Remote GUI";
|
|
genericName = "BitTorrent Client";
|
|
categories = [
|
|
"Network"
|
|
"FileTransfer"
|
|
"P2P"
|
|
"GTK"
|
|
];
|
|
startupNotify = true;
|
|
mimeTypes = [
|
|
"application/x-bittorrent"
|
|
"x-scheme-handler/magnet"
|
|
];
|
|
};
|
|
|
|
postInstall = ''
|
|
mkdir -p "$out/share/applications"
|
|
cp $desktopItem/share/applications/* $out/share/applications
|
|
mkdir -p "$out/share/icons/hicolor/48x48/apps"
|
|
cp transgui.png "$out/share/icons/hicolor/48x48/apps"
|
|
mkdir -p "$out/share/transgui"
|
|
cp -r "./lang" "$out/share/transgui"
|
|
'';
|
|
|
|
passthru.updateScript = unstableGitUpdater {
|
|
tagPrefix = "v";
|
|
};
|
|
|
|
meta = {
|
|
description = "Cross platform front-end for the Transmission BitTorrent client";
|
|
homepage = "https://sourceforge.net/p/transgui";
|
|
license = lib.licenses.gpl2Plus;
|
|
maintainers = with lib.maintainers; [ ramkromberg ];
|
|
mainProgram = "transgui";
|
|
platforms = [
|
|
"x86_64-linux"
|
|
];
|
|
};
|
|
}
|