From e08165fa43c31c2155f5d8d7b4d66dcd39eda9e9 Mon Sep 17 00:00:00 2001 From: aleksana Date: Sat, 7 Sep 2024 15:19:43 +0800 Subject: [PATCH 1/5] amp: format with nixfmt-rfc-style --- pkgs/applications/editors/amp/default.nix | 38 ++++++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/editors/amp/default.nix b/pkgs/applications/editors/amp/default.nix index e559ceb73ec73..dac368068f823 100644 --- a/pkgs/applications/editors/amp/default.nix +++ b/pkgs/applications/editors/amp/default.nix @@ -1,5 +1,17 @@ -{ lib, stdenv, fetchFromGitHub, rustPlatform, openssl, pkg-config, python3, xorg, cmake, libgit2, darwin -, curl }: +{ + lib, + stdenv, + fetchFromGitHub, + rustPlatform, + openssl, + pkg-config, + python3, + xorg, + cmake, + libgit2, + darwin, + curl, +}: rustPlatform.buildRustPackage rec { pname = "amp"; @@ -14,9 +26,25 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-4c72l3R9OyxvslKC4RrIu/Ka3grGxIUCY6iF/NHS5X8="; - nativeBuildInputs = [ cmake pkg-config python3 ]; - buildInputs = [ openssl xorg.libxcb libgit2 ] ++ lib.optionals stdenv.isDarwin - (with darwin.apple_sdk.frameworks; [ curl Security AppKit ]); + nativeBuildInputs = [ + cmake + pkg-config + python3 + ]; + buildInputs = + [ + openssl + xorg.libxcb + libgit2 + ] + ++ lib.optionals stdenv.isDarwin ( + with darwin.apple_sdk.frameworks; + [ + curl + Security + AppKit + ] + ); # Tests need to write to the theme directory in HOME. preCheck = "export HOME=`mktemp -d`"; From 2c6694cd8976cb631f9ed8fe1590007f12887936 Mon Sep 17 00:00:00 2001 From: aleksana Date: Sat, 7 Sep 2024 15:20:45 +0800 Subject: [PATCH 2/5] amp: move to pkgs/by-name --- .../editors/amp/default.nix => by-name/am/amp/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{applications/editors/amp/default.nix => by-name/am/amp/package.nix} (100%) diff --git a/pkgs/applications/editors/amp/default.nix b/pkgs/by-name/am/amp/package.nix similarity index 100% rename from pkgs/applications/editors/amp/default.nix rename to pkgs/by-name/am/amp/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b5ebfb6ac4cba..c9feeab56fd38 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3048,8 +3048,6 @@ with pkgs; ammonite_2_13; ammonite = ammonite_2_13; - amp = callPackage ../applications/editors/amp { }; - ams = callPackage ../applications/audio/ams { }; amtterm = callPackage ../tools/system/amtterm { }; From 673622a5b7efd101748affaa2a641d981f99aee4 Mon Sep 17 00:00:00 2001 From: aleksana Date: Sat, 7 Sep 2024 15:35:32 +0800 Subject: [PATCH 3/5] amp: fix build due to rust 1.80 update --- pkgs/by-name/am/amp/package.nix | 4 +- pkgs/by-name/am/amp/update_time_crate.patch | 56 +++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/am/amp/update_time_crate.patch diff --git a/pkgs/by-name/am/amp/package.nix b/pkgs/by-name/am/amp/package.nix index dac368068f823..c92ca977d364e 100644 --- a/pkgs/by-name/am/amp/package.nix +++ b/pkgs/by-name/am/amp/package.nix @@ -24,7 +24,9 @@ rustPlatform.buildRustPackage rec { sha256 = "sha256-xNadwz2agPbxvgUqrUf1+KsWTmeNh8hJIWcNwTzzM/M="; }; - cargoHash = "sha256-4c72l3R9OyxvslKC4RrIu/Ka3grGxIUCY6iF/NHS5X8="; + cargoPatches = [ ./update_time_crate.patch ]; + + cargoHash = "sha256-EYD1gQgkHemT/3VewdsU5kOGQKY3OjIHRiTSqSRNwtU="; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/am/amp/update_time_crate.patch b/pkgs/by-name/am/amp/update_time_crate.patch new file mode 100644 index 0000000000000..92f6ad73c9ea7 --- /dev/null +++ b/pkgs/by-name/am/amp/update_time_crate.patch @@ -0,0 +1,56 @@ +From 4ce866de7a2e1613951002ff61563a80e19a5c0c Mon Sep 17 00:00:00 2001 +From: Drewry Pope +Date: Wed, 28 Aug 2024 18:45:41 -0500 +Subject: [PATCH] update time + +--- + Cargo.lock | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/Cargo.lock b/Cargo.lock +index 0e1b8ff6..bd8b5814 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -864,6 +864,12 @@ dependencies = [ + "minimal-lexical", + ] + ++[[package]] ++name = "num-conv" ++version = "0.1.0" ++source = "registry+/~https://github.com/rust-lang/crates.io-index" ++checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" ++ + [[package]] + name = "num-traits" + version = "0.2.16" +@@ -1372,12 +1378,13 @@ dependencies = [ + + [[package]] + name = "time" +-version = "0.3.31" ++version = "0.3.36" + source = "registry+/~https://github.com/rust-lang/crates.io-index" +-checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" ++checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" + dependencies = [ + "deranged", + "itoa", ++ "num-conv", + "powerfmt", + "serde", + "time-core", +@@ -1392,10 +1399,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + + [[package]] + name = "time-macros" +-version = "0.2.16" ++version = "0.2.18" + source = "registry+/~https://github.com/rust-lang/crates.io-index" +-checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" ++checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" + dependencies = [ ++ "num-conv", + "time-core", + ] + From 907e4100972d5c424c2e767045cce9533a936865 Mon Sep 17 00:00:00 2001 From: aleksana Date: Sat, 7 Sep 2024 15:36:53 +0800 Subject: [PATCH 4/5] amp: refactor --- pkgs/by-name/am/amp/package.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/am/amp/package.nix b/pkgs/by-name/am/amp/package.nix index c92ca977d364e..36cc922420ce4 100644 --- a/pkgs/by-name/am/amp/package.nix +++ b/pkgs/by-name/am/amp/package.nix @@ -19,9 +19,9 @@ rustPlatform.buildRustPackage rec { src = fetchFromGitHub { owner = "jmacdonald"; - repo = pname; + repo = "amp"; rev = version; - sha256 = "sha256-xNadwz2agPbxvgUqrUf1+KsWTmeNh8hJIWcNwTzzM/M="; + hash = "sha256-xNadwz2agPbxvgUqrUf1+KsWTmeNh8hJIWcNwTzzM/M="; }; cargoPatches = [ ./update_time_crate.patch ]; @@ -51,12 +51,11 @@ rustPlatform.buildRustPackage rec { # Tests need to write to the theme directory in HOME. preCheck = "export HOME=`mktemp -d`"; - meta = with lib; { + meta = { description = "Modern text editor inspired by Vim"; homepage = "https://amp.rs"; - license = [ licenses.gpl3 ]; - maintainers = [ maintainers.sb0 ]; - platforms = platforms.unix; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ sb0 ]; mainProgram = "amp"; }; } From e0dc3fd4285cc2cc570e7ea2bb7a9b94380d9528 Mon Sep 17 00:00:00 2001 From: aleksana Date: Sat, 7 Sep 2024 15:37:16 +0800 Subject: [PATCH 5/5] amp: add aleksana to maintainers --- pkgs/by-name/am/amp/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/am/amp/package.nix b/pkgs/by-name/am/amp/package.nix index 36cc922420ce4..ebb662ee11c8a 100644 --- a/pkgs/by-name/am/amp/package.nix +++ b/pkgs/by-name/am/amp/package.nix @@ -55,7 +55,10 @@ rustPlatform.buildRustPackage rec { description = "Modern text editor inspired by Vim"; homepage = "https://amp.rs"; license = lib.licenses.gpl3Only; - maintainers = with lib.maintainers; [ sb0 ]; + maintainers = with lib.maintainers; [ + sb0 + aleksana + ]; mainProgram = "amp"; }; }