Skip to content

Commit

Permalink
(conan-io#25319) meson: use finalize method
Browse files Browse the repository at this point in the history
* First steps for finalize() support in Meson

---------

Co-authored-by: PerseoGI <[email protected]>

* Modify wrapper in finalize to support old versions cleanly

* Discard changes to recipes/jwt-cpp/all/test_package/traits/defaults.h

* Discard changes to recipes/jwt-cpp/all/test_package/traits/traits.h

* Cealnup

---------

Co-authored-by: PerseoGI <[email protected]>
  • Loading branch information
2 people authored and OMGtechy committed Dec 31, 2024
1 parent 1ffdf24 commit 12070e0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion recipes/meson/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import textwrap

from conan import ConanFile, conan_version
from conan.tools.files import copy, get, rmdir, save
from conan.tools.files import copy, get, rmdir, save, replace_in_file
from conan.tools.layout import basic_layout
from conan.tools.scm import Version

Expand Down Expand Up @@ -52,6 +52,16 @@ def package(self):
exec "$meson_dir/meson.py" "$@"
"""))

def finalize(self):
copy(self, "*", src=self.immutable_package_folder, dst=self.package_folder)
replace_in_file(self, os.path.join(self.package_folder, "bin", "meson.cmd"),
"set PYTHONDONTWRITEBYTECODE=1",
"")

replace_in_file(self, os.path.join(self.package_folder, "bin", "meson"),
"export PYTHONDONTWRITEBYTECODE=1",
"")

@staticmethod
def _chmod_plus_x(filename):
if os.name == "posix":
Expand Down

0 comments on commit 12070e0

Please sign in to comment.