snapcraft: 8.6.1 -> 8.7.0 (#382798)

Jon Seager 64949102 403296f1

Changed files
+11 -29
pkgs
by-name
+6 -14
pkgs/by-name/sn/snapcraft/package.nix
···
python3Packages.buildPythonApplication rec {
pname = "snapcraft";
-
version = "8.6.1";
+
version = "8.7.0";
pyproject = true;
···
owner = "canonical";
repo = "snapcraft";
tag = version;
-
hash = "sha256-SbxsgvDptkUl8gHAIrJvnzIPOh0/R81n8cgJWBH7BXQ=";
+
hash = "sha256-AFqCIqU3XAITrnRp0VzFzvW1LGSJPTFS6VWSR3qF1Pc=";
};
patches = [
···
];
postPatch = ''
-
substituteInPlace setup.py \
-
--replace-fail 'version=determine_version()' 'version="${version}"' \
-
--replace-fail 'gnupg' 'python-gnupg'
-
-
substituteInPlace requirements.txt \
-
--replace-fail 'gnupg==2.3.1' 'python-gnupg'
-
-
substituteInPlace snapcraft/__init__.py \
-
--replace-fail '__version__ = _get_version()' '__version__ = "${version}"'
+
substituteInPlace snapcraft/__init__.py --replace-fail "dev" "${version}"
substituteInPlace snapcraft_legacy/__init__.py \
--replace-fail '__version__ = _get_version()' '__version__ = "${version}"'
···
--replace-fail 'arch_linker_path = Path(arch_config.dynamic_linker)' \
'return str(Path("${glibc}/lib/ld-linux-x86-64.so.2"))'
-
substituteInPlace pyproject.toml \
-
--replace-fail '"pytest-cov>=4.0",' ""
+
substituteInPlace pyproject.toml --replace-fail 'gnupg' 'python-gnupg'
'';
nativeBuildInputs = [ makeWrapper ];
···
validators
];
-
build-system = with python3Packages; [ setuptools ];
+
build-system = with python3Packages; [ setuptools-scm ];
pythonRelaxDeps = [
"craft-parts"
+
"cryptography"
"docutils"
"jsonschema"
"pygit2"
+5 -15
pkgs/by-name/sn/snapcraft/snapcraft-data-dirs.patch
···
diff --git a/snapcraft_legacy/internal/common.py b/snapcraft_legacy/internal/common.py
-
index 6017b405..aacd99a5 100644
+
index b3d40c265..c68c24d53 100644
--- a/snapcraft_legacy/internal/common.py
+++ b/snapcraft_legacy/internal/common.py
-
@@ -34,14 +34,17 @@ from snaphelpers import SnapConfigOptions, SnapCtlError
+
@@ -36,7 +36,10 @@ from snapcraft_legacy.internal import errors
-
from snapcraft_legacy.internal import errors
+
SNAPCRAFT_FILES = ["parts", "stage", "prime"]
+
-_DEFAULT_PLUGINDIR = os.path.join(sys.prefix, "share", "snapcraft", "plugins")
+# Get the path to the Nix store entry for Snapcraft at runtime
+drv = os.path.realpath(__file__).split("/")[3]
+
-
SNAPCRAFT_FILES = ["parts", "stage", "prime"]
-
-_DEFAULT_PLUGINDIR = os.path.join(sys.prefix, "share", "snapcraft", "plugins")
+_DEFAULT_PLUGINDIR = os.path.join(os.sep, "nix", "store", drv, "share", "snapcraft", "plugins")
_plugindir = _DEFAULT_PLUGINDIR
-
-_DEFAULT_SCHEMADIR = os.path.join(sys.prefix, "share", "snapcraft", "schema")
-
+_DEFAULT_SCHEMADIR = os.path.join(os.sep, "nix", "store", drv, "share", "snapcraft", "schema")
-
_schemadir = _DEFAULT_SCHEMADIR
-
-_DEFAULT_EXTENSIONSDIR = os.path.join(sys.prefix, "share", "snapcraft", "extensions")
-
+_DEFAULT_EXTENSIONSDIR = os.path.join(os.sep, "nix", "store", drv, "share", "snapcraft", "extensions")
-
_extensionsdir = _DEFAULT_EXTENSIONSDIR
-
-_DEFAULT_KEYRINGSDIR = os.path.join(sys.prefix, "share", "snapcraft", "keyrings")
-
+_DEFAULT_KEYRINGSDIR = os.path.join(os.sep, "nix", "store", drv, "share", "snapcraft", "keyrings")
-
_keyringsdir = _DEFAULT_KEYRINGSDIR
-
_DOCKERENV_FILE = "/.dockerenv"
+
_BASE_DIR = Path(__file__).parents[2]