Unverified Commit 64949102 authored by Jon Seager's avatar Jon Seager Committed by GitHub
Browse files

snapcraft: 8.6.1 -> 8.7.0 (#382798)

parents 403296f1 11c21de1
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@

python3Packages.buildPythonApplication rec {
  pname = "snapcraft";
  version = "8.6.1";
  version = "8.7.0";

  pyproject = true;

@@ -21,7 +21,7 @@ python3Packages.buildPythonApplication rec {
    owner = "canonical";
    repo = "snapcraft";
    tag = version;
    hash = "sha256-SbxsgvDptkUl8gHAIrJvnzIPOh0/R81n8cgJWBH7BXQ=";
    hash = "sha256-AFqCIqU3XAITrnRp0VzFzvW1LGSJPTFS6VWSR3qF1Pc=";
  };

  patches = [
@@ -43,15 +43,7 @@ python3Packages.buildPythonApplication rec {
  ];

  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}"'
@@ -60,8 +52,7 @@ python3Packages.buildPythonApplication rec {
      --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 ];
@@ -110,10 +101,11 @@ python3Packages.buildPythonApplication rec {
    validators
  ];

  build-system = with python3Packages; [ setuptools ];
  build-system = with python3Packages; [ setuptools-scm ];

  pythonRelaxDeps = [
    "craft-parts"
    "cryptography"
    "docutils"
    "jsonschema"
    "pygit2"
+5 −15
Original line number Diff line number Diff line
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]