Skip to content

Commit 57a287d

Browse files
committed
bison: New package
1 parent 2471d32 commit 57a287d

File tree

2 files changed

+120
-0
lines changed

2 files changed

+120
-0
lines changed

bison-3.7.3+dfsg.cmake

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# This file is part of OpenOrienteering.
2+
3+
# Copyright 2020 Kai Pastor
4+
#
5+
# Redistribution and use is allowed according to the terms of the BSD license:
6+
#
7+
# Redistribution and use in source and binary forms, with or without
8+
# modification, are permitted provided that the following conditions
9+
# are met:
10+
#
11+
# 1. Redistributions of source code must retain the copyright
12+
# notice, this list of conditions and the following disclaimer.
13+
# 2. Redistributions in binary form must reproduce the copyright
14+
# notice, this list of conditions and the following disclaimer in the
15+
# documentation and/or other materials provided with the distribution.
16+
# 3. The name of the author may not be used to endorse or promote products
17+
# derived from this software without specific prior written permission.
18+
#
19+
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20+
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24+
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28+
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
30+
set(version 3.7.3+dfsg)
31+
set(download_hash SHA256=5cdc0edfdf65aa04a4a9f12d6c3b4a09645ef39f61e62624e27895c9b1ebf82a)
32+
set(patch_version ${version}-1)
33+
set(patch_hash SHA256=ed2aea01202e605de03513f59ad4bd63d22cba3dd1b0dc6a9168d15d91689177)
34+
set(base_url https://snapshot.debian.org/archive/debian/20201018T090104Z/pool/main/b/bison/)
35+
36+
option(USE_SYSTEM_BISON "Use the system Bison if possible" ON)
37+
38+
set(test_system_bison [[
39+
if(${USE_SYSTEM_BISON})
40+
enable_language(C)
41+
# Doxygen 1.8.x needs at least Bison 2.7
42+
find_package(BISON 2.7 QUIET)
43+
string(FIND "${BISON_EXECUTABLE}" "${CMAKE_STAGING_PREFIX}/" staging_prefix_start)
44+
if(BISON_EXECUTABLE AND NOT staging_prefix_start EQUAL 0)
45+
message(STATUS "Found ${SYSTEM_NAME} Bison: ${BISON_EXECUTABLE} (${BISON_VERSION})")
46+
set(BUILD_CONDITION 0)
47+
endif()
48+
if(BISON_VERSION AND BISON_VERSION VERSION_LESS 2.7)
49+
message(WARNING "Ignoring ${SYSTEM_NAME} Bison (< 2.7)")
50+
set(BUILD_CONDITION 1)
51+
endif()
52+
endif()
53+
]])
54+
55+
set(bison_texi [[
56+
@setfilename bison.info
57+
]])
58+
59+
superbuild_package(
60+
NAME bison-patches
61+
VERSION ${patch_version}
62+
63+
SOURCE
64+
URL ${base_url}bison_${patch_version}.debian.tar.xz
65+
URL_HASH ${patch_hash}
66+
)
67+
68+
superbuild_package(
69+
NAME bison
70+
VERSION ${patch_version}
71+
DEPENDS
72+
source:bison-patches-${patch_version}
73+
74+
SOURCE_WRITE
75+
bison.texi bison_texi
76+
SOURCE
77+
URL ${base_url}bison_${version}.orig.tar.xz
78+
URL_HASH ${download_hash}
79+
PATCH_COMMAND
80+
"${CMAKE_COMMAND}"
81+
-Dpackage=bison-patches-${patch_version}
82+
-P "${APPLY_PATCHES_SERIES}"
83+
# Fix the issues resulting from Debian DFSG tarball and patching
84+
COMMAND
85+
"${CMAKE_COMMAND}"
86+
-E copy bison.texi doc/bison.texi
87+
COMMAND
88+
touch -r doc/local.mk doc/bison.texi
89+
COMMAND
90+
touch -r doc/local.mk examples/c/lexcalc/local.mk
91+
COMMAND
92+
touch -r doc/local.mk examples/local.mk
93+
94+
USING USE_SYSTEM_BISON patch_version
95+
BUILD_CONDITION ${test_system_bison}
96+
BUILD [[
97+
CONFIGURE_COMMAND
98+
"${SOURCE_DIR}/configure"
99+
"--prefix=${CMAKE_INSTALL_PREFIX}"
100+
$<$<BOOL:@CMAKE_CROSSCOMPILING@>:
101+
--host=${SUPERBUILD_TOOLCHAIN_TRIPLET}
102+
>
103+
--enable-relocatable
104+
--disable-nls
105+
--disable-silent-rules
106+
"CC=${SUPERBUILD_CC}"
107+
"CXX=${SUPERBUILD_CXX}"
108+
"CPPFLAGS=${SUPERBUILD_CPPFLAGS}"
109+
"CFLAGS=${SUPERBUILD_CFLAGS}"
110+
"CXXFLAGS=${SUPERBUILD_CXXFLAGS}"
111+
"LDFLAGS=${SUPERBUILD_LDFLAGS}"
112+
INSTALL_COMMAND
113+
"$(MAKE)" install "DESTDIR=${DESTDIR}${INSTALL_DIR}"
114+
COMMAND
115+
"${CMAKE_COMMAND}" -E copy
116+
"<SOURCE_DIR>/../bison-patches-${patch_version}/copyright"
117+
"${DESTDIR}${CMAKE_STAGING_PREFIX}/share/doc/copyright/bison-${patch_version}.txt"
118+
]]
119+
)

doxygen-1.8.13.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ superbuild_package(
103103
VERSION ${patch_version}
104104
DEPENDS
105105
source:doxygen-patches-${patch_version}
106+
host:bison
106107
libiconv
107108
zlib
108109

0 commit comments

Comments
 (0)