Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xld: init at 20240511 #322367

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions pkgs/by-name/xl/xld/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{ lib
, stdenvNoCC
, fetchurl
, undmg
, writeShellApplication
, curl
, xmlstarlet
, common-updater-scripts
}:

stdenvNoCC.mkDerivation (finalAttrs: {
pname = "xld";
version = "20240511";

src = fetchurl {
url = "mirror://sourceforge/${finalAttrs.pname}/${finalAttrs.pname}-${finalAttrs.version}.dmg";
hash = "sha256-8xfjAWgtSdbD8gGlkGzT8QRz7egIf4PE/rFsFEDX0+c=";
};

buildInputs = [ undmg ];

sourceRoot = ".";

installPhase = ''
runHook preInstall

mkdir -p "$out/Applications" "$out/bin"
cp -r *.app "$out/Applications"
cp -r CLI/xld "$out/bin"

runHook postInstall
'';

postPatch = ''
substituteInPlace CLI/xld \
--replace "/Applications/XLD.app" "$out/Applications/XLD.app"
'';

passthru.updateScript = lib.getExe (writeShellApplication {
name = "xld-update-script";
runtimeInputs = [
curl
xmlstarlet
common-updater-scripts
];
text = ''
url=$(curl --silent "https://svn.code.sf.net/p/xld/code/appcast/xld-appcast_e.xml")
version=$(echo "$url" | xmlstarlet sel -t -v "substring-before(substring-after(//enclosure/@url, 'version='), '&')")
update-source-version xld "$version" --file=./pkgs/by-name/xl/xld/package.nix
'';
});

meta = {
description = "Lossless audio decoder";
homepage = "https://tmkk.undo.jp/xld/index_e.html";
license = lib.licenses.osl3;
maintainers = with lib.maintainers; [ iivusly ];
platforms = lib.platforms.darwin;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
mainProgram = "xld";
};
})