1diff -Nur a/pyproj/datadir.py b/pyproj/datadir.py
2--- a/pyproj/datadir.py 2020-03-24 12:53:39.417440608 +0100
3+++ b/pyproj/datadir.py 2020-03-24 12:56:19.870089479 +0100
4@@ -66,9 +66,7 @@
5 if _VALIDATED_PROJ_DATA is not None:
6 return _VALIDATED_PROJ_DATA
7 global _USER_PROJ_DATA
8- internal_datadir = os.path.join(
9- os.path.dirname(os.path.abspath(__file__)), "proj_dir", "share", "proj"
10- )
11+ internal_datadir = "@proj@/share/proj"
12 proj_lib_dirs = os.environ.get("PROJ_LIB", "")
13 prefix_datadir = os.path.join(sys.prefix, "share", "proj")
14
15diff -Nur a/setup.py b/setup.py
16--- a/setup.py 2020-03-24 12:53:39.415440624 +0100
17+++ b/setup.py 2020-03-24 12:52:05.311232522 +0100
18@@ -11,7 +11,7 @@
19 PROJ_MIN_VERSION = parse_version("6.2.0")
20 CURRENT_FILE_PATH = os.path.dirname(os.path.abspath(__file__))
21 BASE_INTERNAL_PROJ_DIR = "proj_dir"
22-INTERNAL_PROJ_DIR = os.path.join(CURRENT_FILE_PATH, "pyproj", BASE_INTERNAL_PROJ_DIR)
23+INTERNAL_PROJ_DIR = "@proj@"
24
25
26 def check_proj_version(proj_dir):
27@@ -146,7 +146,7 @@
28 # By default we'll try to get options PROJ_DIR or the local version of proj
29 proj_dir = get_proj_dir()
30 library_dirs = get_proj_libdirs(proj_dir)
31- include_dirs = get_proj_incdirs(proj_dir)
32+ include_dirs = get_proj_incdirs("@projdev@")
33
34 # setup extension options
35 ext_options = {
36diff -Nur a/test/conftest.py b/test/conftest.py
37--- a/test/conftest.py 2020-03-24 12:53:39.417440608 +0100
38+++ b/test/conftest.py 2020-03-24 23:16:47.373972786 +0100
39@@ -1,6 +1,7 @@
40 import os
41 import shutil
42 import tempfile
43+import stat
44
45 import pytest
46
47@@ -17,6 +18,15 @@
48 with tempfile.TemporaryDirectory() as tmpdir:
49 tmp_data_dir = os.path.join(tmpdir, "proj")
50 shutil.copytree(data_dir, tmp_data_dir)
51+
52+ # Data copied from the nix store is readonly (causes cleanup problem).
53+ # Make it writable.
54+ for r, d, files in os.walk(tmp_data_dir):
55+ os.chmod(r, os.stat(r).st_mode | stat.S_IWUSR)
56+ for f in files:
57+ fpath = os.path.join(r, f)
58+ os.chmod(fpath, os.stat(fpath).st_mode | stat.S_IWUSR)
59+
60 try:
61 os.remove(os.path.join(str(tmp_data_dir), "ntv2_0.gsb"))
62 except OSError: