Initial import (#1702801)

This commit is contained in:
Shlomi Fish 2019-04-25 19:38:52 +03:00
parent b43bcd3e51
commit deb30ad88d
5 changed files with 172 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/black-hole-solver-0.20.0.tar.xz

32
bhs-no-rpath.diff Normal file
View File

@ -0,0 +1,32 @@
--- black-hole-solver-0.20.0/CMakeLists.txt.orig 2019-04-24 13:25:05.705449647 +0300
+++ black-hole-solver-0.20.0/CMakeLists.txt 2019-04-24 13:25:55.340522389 +0300
@@ -35,29 +35,6 @@
"~$"
)
-### This is to set the RPATH correctly, so when installed under a prefix
-### the executables will find the libraries.
-###
-### See:
-###
-### http://www.cmake.org/Wiki/CMake_RPATH_handling
-###
-### (Taken from that wiki page)
-
-# use, i.e. don't skip the full RPATH for the build tree
-SET(CMAKE_SKIP_BUILD_RPATH FALSE)
-
-# when building, don't use the install RPATH already
-# (but later on when installing)
-SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
-
-# the RPATH to be used when installing
-SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
-
-# add the automatically determined parts of the RPATH
-# which point to directories outside the build tree to the install RPATH
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-
SET (LIB_BASE "black_hole_solver")
option (FCS_WITH_TEST_SUITE "Also build and run the test suite." ON)
option (FCS_AVOID_TCMALLOC "Avoid linking against Google's tcmalloc")

21
bhs-xxhash.patch Normal file
View File

@ -0,0 +1,21 @@
--- black-hole-solver-0.20.0/xxHash-wrapper/wrap_xxhash.h.orig 2019-04-25 13:12:43.484068977 +0300
+++ black-hole-solver-0.20.0/xxHash-wrapper/wrap_xxhash.h 2019-04-25 13:13:01.633166022 +0300
@@ -11,7 +11,6 @@
#pragma once
#include "config.h"
-#define XXH_PRIVATE_API
#include "xxhash.h"
#if SIZEOF_VOID_P == 4
--- black-hole-solver-0.20.0/CMakeLists.txt.orig 2019-04-25 13:16:38.000222097 +0300
+++ black-hole-solver-0.20.0/CMakeLists.txt 2019-04-25 13:17:14.864067712 +0300
@@ -169,7 +169,7 @@
ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
)
-TARGET_LINK_LIBRARIES("${LIB_BASE}" ${LIBTOKYO_CAB_LIBS})
+TARGET_LINK_LIBRARIES("${LIB_BASE}" ${LIBTOKYO_CAB_LIBS} "xxhash")
LIST (APPEND BLACK_HOLE_SOLVER_LIBS "${LIB_BASE}")

117
black-hole-solver.spec Normal file
View File

@ -0,0 +1,117 @@
%define basen black-hole-solver
%define libname_orig lib%{basen}
%define major 1
%define libname lib%{basen}%{major}
%define develname lib%{basen}-devel
Name: %{basen}
Version: 0.20.0
Release: 1%{?dist}
# The entire source code is MIT except xxHash-0.6.5/ which is BSD
License: MIT and BSD
Source0: https://fc-solve.shlomifish.org/downloads/fc-solve/%{basen}-%{version}.tar.xz
Patch1: bhs-no-rpath.diff
Patch2: bhs-xxhash.patch
URL: https://www.shlomifish.org/open-source/projects/black-hole-solitaire-solver/
Requires: %{libname}%{?_isa} = %version-%release
Summary: The Black Hole Solitaire Solver Executable
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: glibc-devel
BuildRequires: perl(Carp)
BuildRequires: perl(Cwd)
BuildRequires: perl(Data::Dumper)
BuildRequires: perl(Dir::Manifest)
BuildRequires: perl(Env::Path)
BuildRequires: perl(File::Path)
BuildRequires: perl(File::Spec)
BuildRequires: perl(Inline)
BuildRequires: perl(Inline::C)
BuildRequires: perl(List::MoreUtils)
BuildRequires: perl(Path::Tiny)
BuildRequires: perl(Test::Differences)
BuildRequires: perl(Test::More)
BuildRequires: perl(Test::RunValgrind)
BuildRequires: perl(Test::Trap)
BuildRequires: perl(autodie)
BuildRequires: perl(base)
BuildRequires: perl(lib)
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
BuildRequires: perl-devel
BuildRequires: python3
BuildRequires: valgrind
BuildRequires: xxhash-devel
%description
This is a solver, written in C, to solve the Solitaire variants “Golf”,
“Black Hole” and “All in a Row”. It provides a portable C library, and
a command line application that after being fed with a layout will emit the
cards to move.
%files
%license COPYING
%doc NEWS README.md TODO.quicktask
%_bindir/black-hole-solve
%{_mandir}/man6/black-hole-solve.6.*
#--------------------------------------------------------------------
%package -n %{libname}
Summary: The Black Hole Solver dynamic libraries
%description -n %{libname}
Contains the Black Hole Solver libraries that are used by some programs.
This package is mandatory for the Black Hole Solver executable too.
%files -n %{libname}
%{_libdir}/libblack_hole_solver.so.%{major}{,.*}
#--------------------------------------------------------------------
%package -n %{develname}
Summary: The Black Hole Solitaire development tools
Requires: %{libname}%{?_isa} = %version-%release
Provides: %{name}-devel = %{version}-%{release}
%description -n %{develname}
Development tools for the Black Hole Solitaire Solver.
%files -n %{develname}
%_includedir/black-hole-solver/*.h
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libblack_hole_solver.so
#--------------------------------------------------------------------
%prep
%setup -q
%autopatch -p1
rm -fr xxHash*/xxHash*
%build
# The game limit flags are recommended by the PySolFC README.
%cmake -DLOCALE_INSTALL_DIR=%{_datadir}/locale -DLIB_INSTALL_DIR=%{_libdir} -DBUILD_STATIC_LIBRARY=
%make_build
%check
%ifarch %arm
# valgrind suppression not working without glibc-debuginfo breaks it
rm -f t/valgrind.t
%endif
rm -f t/clang-format.t
rm -f t/perltidy.t
# fails due to build containing binaries
rm -f t/style-trailing-space.t
# %%make_build test
perl ./run-tests.pl
%install
%{make_install}
rm -f %{buildroot}/%{_libdir}/*.a
%changelog
* Wed Apr 24 2019 Shlomi Fish <shlomif@cpan.org> 0.20.0-1
- Initial Fedora package based on the Mageia one.

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (black-hole-solver-0.20.0.tar.xz) = c7dd7fdb6a6a1fe5faf54a11f99a41f8fd142d2a2ab7e640b7d3853f2246f3bfa714be8675c8dc2db1ab2ade23bedeaa00b320b9ce77124fb17d76141be72aca