jgsogo / conan-apache-apr

[Archived] Recipe available in Conan Center
https://conan.io/center/apr/1.7.0
Apache License 2.0
0 stars 1 forks source link

Hardcoded paths. #6

Closed fulara closed 4 years ago

fulara commented 4 years ago

if anyone is about to use this recipe, be aware that this will indeed work locally but the paths are hardcoded into the resulting artifacts.

so if this is build on ci that generates unique path everytime - this recipe wot do you any good.

I have my own recipe, much simpler than this but this is my stuff:

    def build(self):
        for patch in self.conan_data["patches"][self.version]:
            tools.patch(**patch)
        be = AutoToolsBuildEnvironment(self)
        with tools.chdir(self._source_subfolder):
            with tools.environment_append(be.vars):
                be.configure()
                be.make()

    def package(self):
        be = AutoToolsBuildEnvironment(self)
        with tools.chdir(self._source_subfolder):
            with tools.environment_append(be.vars):
                be.install()
        #rework to python code.
        self.run("sed -i 's@apr_builddir=.*@apr_builddir=${APR_PACKAGE_DIR_CONAN}/build-1@g' " + os.path.join(self.package_folder, "build-1", "apr_rules.mk"))
        self.run("sed -i 's@apr_builders=.*@apr_builders=${APR_PACKAGE_DIR_CONAN}/build-1@g' " + os.path.join(self.package_folder, "build-1", "apr_rules.mk"))
        self.run("sed -i 's@top_builddir=.*@top_builddir=${APR_PACKAGE_DIR_CONAN}/build-1@g' " + os.path.join(self.package_folder, "build-1", "apr_rules.mk"))

    def package_info(self):
       self.cpp_info.libs = tools.collect_libs(self)
       self.env_info.APR_PACKAGE_DIR_CONAN=self.package_folder
       self.output.info("APR_PACKAGE_DIR_CONAN={}".format(self.env_info.APR_PACKAGE_DIR_CONAN))

and patch is :

--- apr.pc.in   2020-04-23 21:35:23.666911834 +0100
+++ apr.pc.in   2020-04-23 21:36:01.728864207 +0100
@@ -1,4 +1,4 @@
-prefix=@prefix@
+prefix=${APR_PACKAGE_DIR_CONAN}
 exec_prefix=@exec_prefix@
 libdir=@libdir@
 APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
--- apr-config.in       2020-04-23 23:18:12.117961998 +0100
+++ apr-config.in       2020-04-23 23:18:54.662175965 +0100
@@ -21,7 +21,7 @@
 APR_MAJOR_VERSION="@APR_MAJOR_VERSION@"
 APR_DOTTED_VERSION="@APR_DOTTED_VERSION@"

-prefix="@prefix@"
+prefix="${APR_PACKAGE_DIR_CONAN}"
 exec_prefix="@exec_prefix@"
 bindir="@bindir@"
 libdir="@libdir@"

I will put this online maybe one day.

jgsogo commented 4 years ago

Recipe already contributed to ConanCenter, I'm archiving this repo

https://github.com/conan-io/conan-center-index/pull/1460 https://conan.io/center/apr/1.7.0