Skip to content

Commit

Permalink
firebird: bump to v5.0.0-rc
Browse files Browse the repository at this point in the history
v5 added a --enable-client-only, which makes the recipe much saner.
  • Loading branch information
valgur committed Nov 3, 2023
1 parent 2e61a37 commit d6ccf1a
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 239 deletions.
6 changes: 3 additions & 3 deletions recipes/firebird/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sources:
"4.0.3":
url: "https://github.com/FirebirdSQL/firebird/archive/refs/tags/v4.0.3.tar.gz"
sha256: "90b799043c83325479989b1f44116d1f0112f77c5def4bb452470bf7a0dcc138"
"5.0.0-rc1":
url: "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.0-RC1/Firebird-5.0.0.1227-ReleaseCandidate1-source.tar.xz"
sha256: "647710a4ccba7dbbb2d0fb14bf6e8a967765b088c3d1c4b5925679a281792a38"
91 changes: 43 additions & 48 deletions recipes/firebird/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from conan.tools.apple import fix_apple_shared_install_name
from conan.tools.build import cross_building
from conan.tools.env import VirtualBuildEnv, VirtualRunEnv
from conan.tools.files import copy, get, chdir, replace_in_file
from conan.tools.files import copy, get, chdir
from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps
from conan.tools.layout import basic_layout
from conan.tools.microsoft import unix_path
Expand All @@ -24,9 +24,6 @@ class FirebirdConan(ConanFile):
package_type = "shared-library"
settings = "os", "arch", "compiler", "build_type"

def export_sources(self):
copy(self, "LICENSE-*", self.recipe_folder, self.export_sources_folder)

def configure(self):
self.settings.rm_safe("compiler.libcxx")
self.settings.rm_safe("compiler.cppstd")
Expand All @@ -35,26 +32,33 @@ def layout(self):
basic_layout(self, src_folder="src")

def requirements(self):
# https://github.com/FirebirdSQL/firebird/tree/v4.0.2/extern
# TODO: should potentially replace these vendored libraries with Conan packages:
# - btyacc
# - editline
# - abseil (for int128)
# - libtommath
# - re2
# Not currently available in ConanCenter:
# - cloop
# - decNumber
# - libtomcrypt
# - SfIO
# - ttmath
self.requires("zlib/[>=1.2.11 <2]")
# Based on the following, with CLIENT_ONLY_FLG=Y
# https://github.com/FirebirdSQL/firebird/blob/v5.0.0-RC1/configure.ac
# https://github.com/FirebirdSQL/firebird/blob/v5.0.0-RC1/builds/posix/Makefile.in#L185-L239
self.requires("icu/73.2")
self.requires("termcap/1.3.1")
# TODO: should potentially unvendor these:
# https://github.com/FirebirdSQL/firebird/tree/v5.0.0-RC1/extern
# - SfIO
# - boost
# - btyacc
# - cloop
# - decNumber
# - editline
# - icu
# - absl (for int128)
# - libcds
# - libtomcrypt
# - libtommath
# - re2
# - ttmath
# - zlib

def validate(self):
if self.settings.os not in ["Linux", "FreeBSD", "Macos"]:
raise ConanInvalidConfiguration(f"{self.ref} recipe is not yet supported on {self.settings.os}.")
if self.settings.os == "Windows":
raise ConanInvalidConfiguration(
f"{self.ref} recipe is not yet supported on Windows. Contributions are welcome."
)

def build_requirements(self):
self.tool_requires("libtool/2.4.7")
Expand All @@ -69,34 +73,25 @@ def generate(self):
env = VirtualRunEnv(self)
env.generate(scope="build")
tc = AutotoolsToolchain(self)
tc.configure_args.append("--enable-client-only")
# Disabled because test_package fails with "double free or corruption (out), Aborted (core dumped)"
# if self.settings.build_type == "Debug":
# tc.configure_args.append("--enable-developer")
tc.configure_args.append("--with-builtin-tommath")
tc.configure_args.append("--with-builtin-tomcrypt")
# Reduce the amount of warnings
tc.extra_cxxflags.append("-Wno-unused-result")
tc.configure_args.append(f"--with-termlib={self.dependencies['termcap'].package_folder}")
tc.extra_ldflags += [
"-L{}".format(unix_path(self, self.dependencies[dep].cpp_info.libdir))
for dep in ["zlib", "icu", "termcap"]
for dep in ["icu", "termcap"]
]
tc.generate()
deps = AutotoolsDeps(self)
deps.generate()

def _patch_sources(self):
# Disable building of examples, plugins and executables.
# Only executables required for the build are included.
# https://github.com/FirebirdSQL/firebird/blob/v4.0.2/builds/posix/Makefile.in#L281-L305
posix_makefile = os.path.join(self.source_folder, "builds/posix/Makefile.in")
for target in ["examples", "plugins"]:
replace_in_file(self, posix_makefile, f"$(MAKE) {target}", "")
replace_in_file(self, posix_makefile, "$(MAKE) utilities", "$(MAKE) isql gbak gfix udfsupport")

def build(self):
self._patch_sources()
with chdir(self, self.source_folder):
autotools = Autotools(self)
# https://github.com/FirebirdSQL/firebird/blob/v4.0.3/autogen.sh#L45-L59
autotools.autoreconf()
self.run("libtoolize --install --copy --force")
# self.run("NOCONFIGURE=1 ./autogen.sh")
autotools.configure()
autotools.make()

Expand All @@ -105,22 +100,22 @@ def package(self):
copy(self, license_file,
src=os.path.join(self.source_folder, "builds", "install", "misc"),
dst=os.path.join(self.package_folder, "licenses"))
copy(self, "LICENSE-*",
src=self.source_folder,
dst=os.path.join(self.package_folder, "licenses"),
keep_path=False)
copy(self,"*",
src=os.path.join(self.source_folder, f"gen/{self.settings.build_type}/firebird/lib"),
dst=os.path.join(self.package_folder, "lib"))
copy(self, "*",
src=os.path.join(self.source_folder, "src/include"),
dst=os.path.join(self.package_folder, "include"))
with chdir(self, self.source_folder):
autotools = Autotools(self)
autotools.make(target="dist")
# build_type = "Debug" if self.settings.build_type == "Debug" else "Release"
build_type = "Release"
dist_root = os.path.join(self.source_folder, "gen", build_type, "firebird")
copy(self,"*", os.path.join(dist_root, "include"), os.path.join(self.package_folder, "include"))
copy(self,"*", os.path.join(dist_root, "lib"), os.path.join(self.package_folder, "lib"))
copy(self,"*", os.path.join(dist_root, "bin"), os.path.join(self.package_folder, "bin"))
fix_apple_shared_install_name(self)

def package_info(self):
self.cpp_info.set_property("pkg_config_name", "firebird")

self.cpp_info.libs = ["fbclient", "ib_util", "decFloat", "edit", "re2", "tomcrypt", "tommath"]
self.cpp_info.libs = ["fbclient"]
# TODO: unvendor
self.cpp_info.libs += ["tomcrypt", "tommath"]

if self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs.extend(["dl", "m", "pthread"])
14 changes: 0 additions & 14 deletions recipes/firebird/all/licenses/LICENSE-SfIO

This file was deleted.

10 changes: 0 additions & 10 deletions recipes/firebird/all/licenses/LICENSE-abseil

This file was deleted.

14 changes: 0 additions & 14 deletions recipes/firebird/all/licenses/LICENSE-btyacc

This file was deleted.

18 changes: 0 additions & 18 deletions recipes/firebird/all/licenses/LICENSE-cloop

This file was deleted.

14 changes: 0 additions & 14 deletions recipes/firebird/all/licenses/LICENSE-decNumber

This file was deleted.

29 changes: 0 additions & 29 deletions recipes/firebird/all/licenses/LICENSE-editline

This file was deleted.

29 changes: 0 additions & 29 deletions recipes/firebird/all/licenses/LICENSE-libtomcrypt

This file was deleted.

4 changes: 0 additions & 4 deletions recipes/firebird/all/licenses/LICENSE-libtommath

This file was deleted.

27 changes: 0 additions & 27 deletions recipes/firebird/all/licenses/LICENSE-re2

This file was deleted.

28 changes: 0 additions & 28 deletions recipes/firebird/all/licenses/LICENSE-ttmath

This file was deleted.

2 changes: 1 addition & 1 deletion recipes/firebird/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
versions:
"4.0.3":
"5.0.0-rc1":
folder: all

0 comments on commit d6ccf1a

Please sign in to comment.