├── .github └── workflows │ ├── darwin-arm64.yml │ ├── darwin-x64.yml │ ├── linux-arm64.yml │ ├── linux-x64.yml │ ├── test.yml │ └── windows-x64.yml ├── .gitignore ├── COPYING ├── README.md ├── builder.py ├── default ├── patches │ ├── CaDiCaL_20190730.patch │ ├── Lingeling_20190110.patch │ ├── README │ ├── Toolchain-mingw64.cmake │ ├── activate │ ├── avy.diff │ ├── cacert.pem │ ├── environment │ ├── environment.bat │ ├── environment.fish │ ├── environment.ps1 │ ├── fonts.conf.template │ ├── get-antlr-3.4 │ ├── graphviz_fix.diff │ ├── openocd.diff │ ├── python27.diff │ ├── python3.11.6-darwin.diff │ ├── python3.11.6-mingw.diff │ ├── python3_package.sh │ ├── smt-switch-win32.diff │ ├── start.bat │ ├── suprove.diff │ ├── symfpu_20201114.patch │ ├── tabbyadm │ └── win-launcher.c ├── rules │ ├── .gitignore │ ├── __init__.py │ ├── cocotb.py │ ├── default.py │ ├── eqy.py │ ├── formal.py │ ├── ghdl.py │ ├── gtkwave.py │ ├── iverilog.py │ ├── nextpnr.py │ ├── programmers.py │ ├── pyhdl.py │ ├── python.py │ ├── resources-min.py │ ├── resources.py │ ├── solvers.py │ ├── utils.py │ ├── verilator.py │ └── yosys.py └── scripts │ ├── abc.sh │ ├── aiger.sh │ ├── apicula-bba.sh │ ├── apicula.sh │ ├── avy.sh │ ├── bitwuzla.sh │ ├── boolector.sh │ ├── btor2tools.sh │ ├── cadical.sh │ ├── cocotb.sh │ ├── cvc4.sh │ ├── cvc5.sh │ ├── eqy.sh │ ├── formal.sh │ ├── gatemate-bba.sh │ ├── ghdl-yosys-plugin.sh │ ├── ghdl.sh │ ├── graphviz.sh │ ├── gtkwave.sh │ ├── icestorm-bba.sh │ ├── icestorm.sh │ ├── imctk.sh │ ├── iverilog.sh │ ├── libpoly.sh │ ├── lingeling.sh │ ├── nextpnr-bba.sh │ ├── nextpnr-ecp5.sh │ ├── nextpnr-generic.sh │ ├── nextpnr-himbaechel.sh │ ├── nextpnr-ice40.sh │ ├── nextpnr-machxo2.sh │ ├── nextpnr-mistral.sh │ ├── nextpnr-nexus.sh │ ├── numpy.sh │ ├── openfpgaloader.sh │ ├── picosat.sh │ ├── pono.sh │ ├── prjoxide-bba.sh │ ├── prjoxide.sh │ ├── prjpeppercorn.sh │ ├── prjtrellis-bba.sh │ ├── prjtrellis.sh │ ├── pyhdl.sh │ ├── python-programmers.sh │ ├── python2-native.sh │ ├── python2.sh │ ├── python3-native.sh │ ├── python3.sh │ ├── slang.sh │ ├── smt-switch.sh │ ├── suprove.sh │ ├── symfpu.sh │ ├── system-resources-min.sh │ ├── system-resources-tabby.sh │ ├── system-resources.sh │ ├── utils.sh │ ├── verilator.sh │ ├── xdot.sh │ ├── yices.sh │ ├── yosys-slang-plugin.sh │ ├── yosys.sh │ └── z3.sh ├── docker ├── cross-base │ ├── Dockerfile │ └── build.sh ├── cross-darwin-arm64 │ ├── Dockerfile │ ├── Dockerfile.21 │ ├── Dockerfile.22 │ ├── Toolchain.cmake │ ├── build.sh │ ├── gschemas.compiled │ └── uname ├── cross-darwin-x64 │ ├── Dockerfile │ ├── Dockerfile.21 │ ├── Dockerfile.22 │ ├── Toolchain.cmake │ ├── build.sh │ ├── gschemas.compiled │ └── uname ├── cross-linux-arm64 │ ├── Dockerfile │ ├── Dockerfile.21 │ ├── Dockerfile.22 │ ├── Toolchain.cmake │ └── build.sh ├── cross-linux-x64 │ ├── Dockerfile │ ├── Dockerfile.21 │ ├── Dockerfile.22 │ └── build.sh ├── cross-windows-x64 │ ├── Dockerfile │ ├── Dockerfile.21 │ ├── Dockerfile.22 │ ├── Toolchain.cmake │ └── build.sh ├── delete_containers.sh └── delete_dangling_images.sh ├── libvcs ├── .gitignore ├── LICENSE ├── __about__.py ├── __init__.py ├── _compat.py ├── base.py ├── exc.py ├── git.py ├── hg.py ├── shortcuts.py ├── svn.py └── util.py ├── scripts ├── package-darwin.sh ├── package-linux.sh └── package-windows.sh └── src ├── .gitignore └── base.py /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: 4 | workflow_dispatch: 5 | workflow_run: 6 | workflows: [ linux-x64 ] 7 | types: 8 | - completed 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Get latest sby sources 16 | uses: actions/checkout@v4 17 | with: 18 | repository: YosysHQ/sby 19 | - name: Setup test environment 20 | uses: YosysHQ/setup-oss-cad-suite@v3 21 | with: 22 | github-token: ${{ secrets.GITHUB_TOKEN }} 23 | python-override: true 24 | - name: Run checks 25 | run: tabbypip install xmlschema && make ci 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /_sources 2 | /_outputs 3 | /_builds 4 | /__pycache__ 5 | .vscode/ -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (C) 2021 Miodrag Milanovic 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /builder.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import click, signal, os, sys, shutil 4 | from src.base import loadRules, validateRules, pullCode, buildCode, validateTarget, validateArch, cleanBuild, getArchitecture, generateYaml, architectures 5 | 6 | def force_shutdown(signum, frame): 7 | if (os.name != 'nt' and signum != signal.SIGPIPE): 8 | click.secho("\n==> Keyboard interrupt or external termination signal", fg="red", nl=True, bold=True) 9 | sys.exit(1) 10 | 11 | @click.group(help="""OSS CAD Suite Builder\n""", context_settings=dict(help_option_names=["-h", "--help"]), invoke_without_command=True) 12 | @click.pass_context 13 | def cli(ctx): 14 | ctx.ensure_object(dict) 15 | if ctx.invoked_subcommand is None: 16 | click.secho(ctx.get_help()) 17 | pass 18 | 19 | @cli.command() 20 | @click.option('--no-update', help='Do not update source files.', is_flag=True) 21 | @click.option('--force', help='Force build of specified target.', is_flag=True) 22 | @click.option('--target', default='default', show_default=True, help='Target project to build.') 23 | @click.option('--arch', default=getArchitecture(), show_default=True, help='Build architecture.') 24 | @click.option('--rules', default='default', show_default=True, help='Comma separated list of rules to use.') 25 | @click.option('--dry', help='Just dry run of packages to be built', is_flag=True) 26 | @click.option('--src', help='Pack sources where applicable', is_flag=True) 27 | @click.option('--single', help='Single target build (for CI only)', is_flag=True) 28 | @click.option('--tar', help='Single target package (for CI only)', is_flag=True) 29 | @click.option('-j', '--nproc', default=os.cpu_count(), show_default=True, help='Number of build process.') 30 | def build(no_update, force, target, arch, rules, dry, src, single, tar, nproc): 31 | """Build tools""" 32 | for rule in rules.split(","): 33 | loadRules(rule) 34 | validateRules() 35 | validateTarget(target) 36 | validateArch(arch) 37 | pullCode(target, arch, getArchitecture(), no_update, single) 38 | buildCode(target, arch, nproc, force, dry, src, single, tar) 39 | 40 | @cli.command() 41 | @click.option('--arch', default=getArchitecture(), show_default=True, help='Build architecture.') 42 | @click.option('--full', help='Remove all architectures and sources as well.', is_flag=True) 43 | def clean(arch, full): 44 | """Clean build""" 45 | cleanBuild(arch, full) 46 | 47 | @cli.command() 48 | @click.option('--target', default='default', show_default=True, help='Target project to build.') 49 | @click.option('--arch', default=getArchitecture(), show_default=True, help='Build architecture.') 50 | @click.option('--rules', default='default', show_default=True, help='Comma separated list of rules to use.') 51 | def source(target, arch, rules): 52 | """Update sources""" 53 | for rule in rules.split(","): 54 | loadRules(rule) 55 | validateRules() 56 | validateTarget(target) 57 | validateArch(arch) 58 | pullCode(target, arch, getArchitecture(), False, False) 59 | 60 | @cli.command() 61 | @click.option('--target', default='default', show_default=True, help='Target project to build.') 62 | @click.option('--arch', default=getArchitecture(), show_default=True, help='Build architecture.') 63 | @click.option('--rules', default='default', show_default=True, help='Comma separated list of rules to use.') 64 | @click.option('--all', help='Single target package (for CI only)', is_flag=True) 65 | def ci(target, arch, rules, all): 66 | """Generate yaml for GitHub Actions""" 67 | for rule in rules.split(","): 68 | loadRules(rule) 69 | validateRules() 70 | validateTarget(target) 71 | validateArch(arch) 72 | if all: 73 | for val in architectures: 74 | generateYaml("default", val, all) 75 | else: 76 | generateYaml(target, arch, all) 77 | 78 | if __name__ == '__main__': 79 | if os.name == "posix": 80 | signal.signal(signal.SIGHUP, force_shutdown) 81 | signal.signal(signal.SIGPIPE, force_shutdown) 82 | signal.signal(signal.SIGINT, force_shutdown) 83 | signal.signal(signal.SIGTERM, force_shutdown) 84 | 85 | cli(None) 86 | -------------------------------------------------------------------------------- /default/patches/CaDiCaL_20190730.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/mobical.cpp b/src/mobical.cpp 2 | index 52f3b83..217f359 100644 3 | --- a/src/mobical.cpp 4 | +++ b/src/mobical.cpp 5 | @@ -693,8 +693,12 @@ public: 6 | SIGNAL(SIGSEGV) \ 7 | SIGNAL(SIGABRT) \ 8 | SIGNAL(SIGTERM) \ 9 | + 10 | +#ifdef NWINDOWS 11 | SIGNAL(SIGBUS) \ 12 | 13 | +#endif 14 | + 15 | #define SIGNAL(SIG) \ 16 | static void (*old_ ## SIG ## _handler) (int); 17 | SIGNALS 18 | @@ -1414,8 +1418,10 @@ extern "C" { 19 | #include 20 | #include 21 | #include 22 | +#ifdef NWINDOWS 23 | #include 24 | #include 25 | +#endif 26 | #include 27 | } 28 | 29 | @@ -1437,6 +1443,7 @@ void Trace::reset_child_signal_handlers () { 30 | } 31 | 32 | void Trace::child_signal_handler (int sig) { 33 | +#ifdef NWINDOWS 34 | struct rusage u; 35 | if (!getrusage (RUSAGE_SELF, &u)) { 36 | if ((int64_t) u.ru_maxrss >> 10 >= mobical.space_limit) { 37 | @@ -1455,6 +1462,7 @@ void Trace::child_signal_handler (int sig) { 38 | } 39 | reset_child_signal_handlers (); 40 | raise (sig); 41 | +#endif 42 | } 43 | 44 | void Trace::init_child_signal_handlers () { 45 | @@ -1467,11 +1475,16 @@ void Trace::init_child_signal_handlers () { 46 | int Trace::fork_and_execute () { 47 | 48 | cerr << flush; 49 | - pid_t child = mobical.donot.fork ? 0 : fork (); 50 | + pid_t child = 51 | +#ifdef NWINDOWS 52 | + mobical.donot.fork ? 0 : fork (); 53 | +#else 54 | + 0; 55 | +#endif 56 | int res = 0; 57 | 58 | if (child) { 59 | - 60 | +#ifdef NWINDOWS 61 | executed++; 62 | 63 | int status, other = wait (&status); 64 | @@ -1480,23 +1493,28 @@ int Trace::fork_and_execute () { 65 | else if (!WIFSIGNALED (status)) res = 0; 66 | else if (mobical.donot.ignore_resource_limits) res = 1; 67 | else res = (WTERMSIG (status) != SIGXCPU); 68 | +#endif 69 | 70 | } else { 71 | 72 | if (!mobical.donot.fork && mobical.time_limit) { 73 | +#ifdef NWINDOWS 74 | struct rlimit rlim; 75 | if (!getrlimit (RLIMIT_CPU, &rlim)) { 76 | rlim.rlim_cur = mobical.time_limit; 77 | setrlimit (RLIMIT_CPU, &rlim); 78 | } 79 | +#endif 80 | } 81 | 82 | if (!mobical.donot.fork && mobical.space_limit) { 83 | +#ifdef NWINDOWS 84 | struct rlimit rlim; 85 | if (!getrlimit (RLIMIT_AS, &rlim)) { 86 | rlim.rlim_cur = mobical.space_limit * (1l << 20); 87 | setrlimit (RLIMIT_AS, &rlim); 88 | } 89 | +#endif 90 | } 91 | 92 | init_child_signal_handlers (); 93 | @@ -2480,7 +2498,9 @@ void Mobical::header () { 94 | /*------------------------------------------------------------------------*/ 95 | 96 | extern "C" { 97 | +#ifdef NWINDOWS 98 | #include 99 | +#endif 100 | } 101 | 102 | Mobical::Mobical () 103 | @@ -2504,13 +2524,17 @@ Mobical::Mobical () 104 | traces (0), 105 | spurious (0) 106 | { 107 | +#ifdef NWINDOWS 108 | const int prot = PROT_READ | PROT_WRITE; 109 | const int flags = MAP_ANONYMOUS | MAP_SHARED; 110 | shared = (Shared*) mmap (0, sizeof *shared, prot, flags, 0, 0); 111 | +#endif 112 | } 113 | 114 | Mobical::~Mobical () { 115 | +#ifdef NWINDOWS 116 | if (shared) munmap (shared, sizeof *shared); 117 | +#endif 118 | } 119 | 120 | void Mobical::catch_signal (int) { 121 | @@ -2534,6 +2558,10 @@ int Mobical::main (int argc, char ** argv) { 122 | 123 | int64_t limit = -1; 124 | 125 | +#ifndef NWINDOWS 126 | + donot.fork = true; 127 | +#endif 128 | + 129 | // Error message in 'die' also uses colors. 130 | // 131 | for (int i = 1; i < argc; i++) 132 | diff --git a/src/resources.cpp b/src/resources.cpp 133 | index b21416d..d0b91c6 100644 134 | --- a/src/resources.cpp 135 | +++ b/src/resources.cpp 136 | @@ -7,7 +7,9 @@ 137 | 138 | extern "C" { 139 | #include 140 | +#ifdef NWINDOWS 141 | #include 142 | +#endif 143 | #include 144 | #include 145 | #include 146 | @@ -32,12 +34,16 @@ double Internal::real_time () { 147 | // etc. For different variants of Unix not all fields are meaningful. 148 | 149 | double absolute_process_time () { 150 | +#ifdef NWINDOWS 151 | struct rusage u; 152 | double res; 153 | if (getrusage (RUSAGE_SELF, &u)) return 0; 154 | res = u.ru_utime.tv_sec + 1e-6 * u.ru_utime.tv_usec; // user time 155 | res += u.ru_stime.tv_sec + 1e-6 * u.ru_stime.tv_usec; // + system time 156 | return res; 157 | +#else 158 | + return 0; 159 | +#endif 160 | } 161 | 162 | double Internal::process_time () { 163 | @@ -49,9 +55,13 @@ double Internal::process_time () { 164 | // This seems to work on Linux (man page says since Linux 2.6.32). 165 | 166 | size_t maximum_resident_set_size () { 167 | +#ifdef NWINDOWS 168 | struct rusage u; 169 | if (getrusage (RUSAGE_SELF, &u)) return 0; 170 | return ((size_t) u.ru_maxrss) << 10; 171 | +#else 172 | + return 0; 173 | +#endif 174 | } 175 | 176 | // Unfortunately 'getrusage' on Linux does not support current resident set 177 | @@ -62,6 +72,7 @@ size_t maximum_resident_set_size () { 178 | // '_SC_PAGESIZE' are available). 179 | 180 | size_t current_resident_set_size () { 181 | +#ifdef NWINDOWS 182 | char path[40]; 183 | sprintf (path, "/proc/%" PRId64 "/statm", (int64_t) getpid ()); 184 | FILE * file = fopen (path, "r"); 185 | @@ -70,6 +81,9 @@ size_t current_resident_set_size () { 186 | int scanned = fscanf (file, "%" PRId64 " %" PRId64 "", &dummy, &rss); 187 | fclose (file); 188 | return scanned == 2 ? rss * sysconf (_SC_PAGESIZE) : 0; 189 | +#else 190 | + return 0; 191 | +#endif 192 | } 193 | 194 | } 195 | diff --git a/src/signal.cpp b/src/signal.cpp 196 | index 2b435a3..df255e0 100644 197 | --- a/src/signal.cpp 198 | +++ b/src/signal.cpp 199 | @@ -25,15 +25,23 @@ static bool alarm_set = false; 200 | static int alarm_time = -1; 201 | static Handler * signal_handler; 202 | 203 | +#ifdef NWINDOWS 204 | void Handler::catch_alarm () { catch_signal (SIGALRM); } 205 | +#else 206 | +void Handler::catch_alarm () { } 207 | +#endif 208 | 209 | #define SIGNALS \ 210 | SIGNAL(SIGABRT) \ 211 | -SIGNAL(SIGBUS) \ 212 | SIGNAL(SIGINT) \ 213 | SIGNAL(SIGSEGV) \ 214 | SIGNAL(SIGTERM) \ 215 | 216 | +#ifdef NWINDOWS 217 | +SIGNAL(SIGBUS) \ 218 | + 219 | +#endif 220 | + 221 | #define SIGNAL(SIG) \ 222 | static void (*SIG ## _handler)(int); 223 | SIGNALS 224 | @@ -42,7 +50,9 @@ static void (*SIGALRM_handler)(int); 225 | 226 | void Signal::reset_alarm () { 227 | if (!alarm_set) return; 228 | +#ifdef NWINDOWS 229 | (void) signal (SIGALRM, SIGALRM_handler); 230 | +#endif 231 | SIGALRM_handler = 0; 232 | caught_alarm = false; 233 | alarm_set = false; 234 | @@ -65,7 +75,9 @@ const char * Signal::name (int sig) { 235 | if (sig == SIG) return # SIG; 236 | SIGNALS 237 | #undef SIGNAL 238 | +#ifdef NWINDOWS 239 | if (sig == SIGALRM) return "SIGALRM"; 240 | +#endif 241 | return "UNKNOWN"; 242 | } 243 | 244 | @@ -76,6 +88,7 @@ const char * Signal::name (int sig) { 245 | // exclusive access to. All these solutions are painful and not elegant. 246 | 247 | static void catch_signal (int sig) { 248 | +#ifdef NWINDOWS 249 | if (sig == SIGALRM && absolute_real_time () >= alarm_time) { 250 | if (!caught_alarm) { 251 | caught_alarm = true; 252 | @@ -83,6 +96,9 @@ static void catch_signal (int sig) { 253 | } 254 | Signal::reset_alarm (); 255 | } else { 256 | +#else 257 | + { 258 | +#endif 259 | if (!caught_signal) { 260 | caught_signal = true; 261 | if (signal_handler) signal_handler->catch_signal (sig); 262 | @@ -101,6 +117,7 @@ SIGNALS 263 | } 264 | 265 | void Signal::alarm (int seconds) { 266 | +#ifdef NWINDOWS 267 | assert (seconds >= 0); 268 | assert (!alarm_set); 269 | assert (alarm_time < 0); 270 | @@ -108,6 +125,7 @@ void Signal::alarm (int seconds) { 271 | alarm_set = true; 272 | alarm_time = absolute_real_time () + seconds; 273 | ::alarm (seconds); 274 | +#endif 275 | } 276 | 277 | } 278 | diff --git a/test/makefile b/test/makefile 279 | index b45d063..8bf2c14 100644 280 | --- a/test/makefile 281 | +++ b/test/makefile 282 | @@ -1,4 +1,4 @@ 283 | -test: usage trace api cnf mbt 284 | +test: usage cnf trace # api mbt 285 | api: 286 | @api/run.sh 287 | cnf: 288 | -------------------------------------------------------------------------------- /default/patches/Lingeling_20190110.patch: -------------------------------------------------------------------------------- 1 | diff --git a/lglib.c b/lglib.c 2 | --- a/lglib.c 3 | +++ b/lglib.c 4 | @@ -20,7 +20,9 @@ 5 | #include 6 | #include 7 | #include 8 | +#ifdef NWINDOWS 9 | #include 10 | +#endif 11 | #include 12 | #include 13 | #include 14 | @@ -1289,12 +1291,15 @@ static void lglogstart (LGL * lgl, int level, const char * msg, ...) { 15 | /*------------------------------------------------------------------------*/ 16 | 17 | double lglprocesstime (void) { 18 | +#ifdef NWINDOWS 19 | struct rusage u; 20 | double res; 21 | if (getrusage (RUSAGE_SELF, &u)) return 0; 22 | res = u.ru_utime.tv_sec + 1e-6 * u.ru_utime.tv_usec; 23 | res += u.ru_stime.tv_sec + 1e-6 * u.ru_stime.tv_usec; 24 | return res; 25 | +#endif 26 | + return 0; 27 | } 28 | 29 | static double lglgetime (LGL * lgl) { 30 | diff --git a/lglib.h b/lglib.h 31 | index c5c89cc..b034334 100644 32 | --- a/lglib.h 33 | +++ b/lglib.h 34 | @@ -6,7 +6,8 @@ 35 | #define lglib_h_INCLUDED 36 | 37 | #include // for 'FILE' 38 | -#include // for 'int64_t' 39 | +#include 40 | +#include // for 'int64_t' 41 | 42 | //-------------------------------------------------------------------------- 43 | 44 | diff --git a/lglmain.c b/lglmain.c 45 | index 2dc2b67..36c61d2 100644 46 | --- a/lglmain.c 47 | +++ b/lglmain.c 48 | @@ -31,7 +31,9 @@ static void resetsighandlers (void) { 49 | (void) signal (SIGSEGV, sig_segv_handler); 50 | (void) signal (SIGABRT, sig_abrt_handler); 51 | (void) signal (SIGTERM, sig_term_handler); 52 | +#ifdef NWINDOWS 53 | (void) signal (SIGBUS, sig_bus_handler); 54 | +#endif 55 | } 56 | 57 | static void caughtsigmsg (int sig) { 58 | @@ -42,8 +44,10 @@ static void caughtsigmsg (int sig) { 59 | case SIGSEGV: printf (" SIGSEGV"); break; 60 | case SIGABRT: printf (" SIGABRT"); break; 61 | case SIGTERM: printf (" SIGTERM"); break; 62 | +#ifdef NWINDOWS 63 | case SIGBUS: printf (" SIGBUS"); break; 64 | case SIGALRM: printf (" SIGALRM"); break; 65 | +#endif 66 | default: break; 67 | } 68 | printf ("\nc\n"); 69 | @@ -71,12 +75,15 @@ static void setsighandlers (void) { 70 | sig_segv_handler = signal (SIGSEGV, catchsig); 71 | sig_abrt_handler = signal (SIGABRT, catchsig); 72 | sig_term_handler = signal (SIGTERM, catchsig); 73 | +#ifdef NWINDOWS 74 | sig_bus_handler = signal (SIGBUS, catchsig); 75 | +#endif 76 | } 77 | 78 | static int timelimit = -1, caughtalarm = 0; 79 | 80 | static void catchalrm (int sig) { 81 | +#ifdef NWINDOWS 82 | assert (sig == SIGALRM); 83 | if (!caughtalarm) { 84 | caughtalarm = 1; 85 | @@ -87,6 +94,7 @@ static void catchalrm (int sig) { 86 | fflush (stdout); 87 | } 88 | } 89 | +#endif 90 | } 91 | 92 | static int checkalarm (void * ptr) { 93 | @@ -513,8 +521,10 @@ ERR: 94 | fflush (stdout); 95 | } 96 | lglseterm (lgl, checkalarm, &caughtalarm); 97 | +#ifdef NWINDOWS 98 | sig_alrm_handler = signal (SIGALRM, catchalrm); 99 | alarm (timelimit); 100 | +#endif 101 | } 102 | for (i = 0; i < ntargets; i++) lglassume (lgl, targets[i]); 103 | if (simplevel > 0) { 104 | @@ -532,7 +542,9 @@ ERR: 105 | res = lglsat (lgl); 106 | if (timelimit >= 0) { 107 | caughtalarm = 0; 108 | +#ifdef NWINDOWS 109 | (void) signal (SIGALRM, sig_alrm_handler); 110 | +#endif 111 | } 112 | if (oname) { 113 | double start = lglsec (lgl), delta; 114 | diff --git a/makefile.in b/makefile.in 115 | index 4914087..7148dea 100644 116 | --- a/makefile.in 117 | +++ b/makefile.in 118 | @@ -15,8 +15,10 @@ all: targets 119 | -include makefile.other 120 | 121 | targets: liblgl.a 122 | -targets: lingeling plingeling ilingeling treengeling 123 | -targets: lglmbt lgluntrace lglddtrace 124 | +targets: lingeling 125 | +# targets: plingeling ilingeling treengeling 126 | +# targets: lglmbt 127 | +# targets: lgluntrace lglddtrace 128 | targets: @AIGERTARGETS@ 129 | 130 | analyze: 131 | -------------------------------------------------------------------------------- /default/patches/README: -------------------------------------------------------------------------------- 1 | OSS CAD Suite 2 | ============= 3 | 4 | Did you know that the Tabby CAD version of yosys supports industry standard SystemVerilog, VHDL and SVA? 5 | Contact us at contact@yosyshq.com to arrange a free evaluation license. 6 | 7 | Installation 8 | ------------ 9 | 10 | 1. Download an archive matching your OS from the releases page at https://github.com/YosysHQ/oss-cad-suite-build/releases/latest. 11 | 2. Extract the archive to a location of your choice (for Windows it is recommended that path does not contain spaces) 12 | 3. On macOS to allow execution of quarantined files run: ```./activate``` in extracted location once 13 | 4. Set the environment as described below. 14 | 15 | Linux and macOS 16 | --------------- 17 | export PATH="/oss-cad-suite/bin:$PATH" 18 | 19 | with fish shell: 20 | fish_add_path "/oss-cad-suite/bin" 21 | 22 | Windows 23 | ------- 24 | from existing shell: 25 | \oss-cad-suite\environment.bat 26 | 27 | to create new shell window: 28 | \oss-cad-suite\start.bat 29 | 30 | Using the bundled Python3 (Linux and macOS only) 31 | ------------------------------------------------ 32 | 33 | If you want to use the bundled version of Python, for example with nmigen, nextpnr scripting or LiteX, then you can call it with tabbypy3. 34 | 35 | We also provide a virtual environment that you can setup like this: 36 | 37 | source /oss-cad-suite/environment 38 | 39 | or with fish shell: 40 | 41 | source /oss-cad-suite/environment.fish 42 | -------------------------------------------------------------------------------- /default/patches/Toolchain-mingw64.cmake: -------------------------------------------------------------------------------- 1 | SET(CMAKE_SYSTEM_NAME Windows) 2 | SET(CMAKE_SYSTEM_PROCESSOR x86_64) 3 | 4 | SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc) 5 | SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++) 6 | 7 | SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32/sys-root/mingw) 8 | 9 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 10 | #SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 11 | #SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 12 | 13 | SET(QT_BINARY_DIR /usr/x86_64-w64-mingw32/bin /usr/bin) 14 | 15 | SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres) 16 | 17 | SET(CMAKE_AR:FILEPATH /usr/bin/x86_64-w64-mingw32-ar) 18 | SET(CMAKE_RANLIB:FILEPATH /usr/bin/x86_64-w64-mingw32-ranlib) 19 | 20 | SET(CMAKE_PREFIX_PATH /usr/x86_64-w64-mingw32/sys-root/mingw/share/cmake/Modules) 21 | 22 | set(Boost_ARCHITECTURE "-x64") 23 | -------------------------------------------------------------------------------- /default/patches/activate: -------------------------------------------------------------------------------- 1 | echo "Please wait" 2 | echo "Removing quarantine flag from all files and directories..." 3 | sudo find . -exec xattr -d com.apple.quarantine {} 2> /dev/null \; 4 | echo "Done" 5 | -------------------------------------------------------------------------------- /default/patches/environment: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | if [ "${BASH_SOURCE-}" = "$0" ]; then 3 | echo "You must source this script: \$ source $0" >&2 4 | exit 1 5 | fi 6 | 7 | deactivate () { 8 | # reset old environment variables 9 | # ! [ -z ${VAR+_} ] returns true if VAR is declared at all 10 | if ! [ -z "${_OLD_ENVIRONMENT_PATH:+_}" ] ; then 11 | PATH="$_OLD_ENVIRONMENT_PATH" 12 | export PATH 13 | unset _OLD_ENVIRONMENT_PATH 14 | fi 15 | if ! [ -z "${_OLD_ENVIRONMENT_PYTHONHOME+_}" ] ; then 16 | PYTHONHOME="$_OLD_ENVIRONMENT_PYTHONHOME" 17 | export PYTHONHOME 18 | unset _OLD_ENVIRONMENT_PYTHONHOME 19 | fi 20 | 21 | # This should detect bash and zsh, which have a hash command that must 22 | # be called to get it to forget past commands. Without forgetting 23 | # past commands the $PATH changes we made may not be respected 24 | if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then 25 | hash -r 2>/dev/null 26 | fi 27 | 28 | if ! [ -z "${_OLD_ENVIRONMENT_PS1+_}" ] ; then 29 | PS1="$_OLD_ENVIRONMENT_PS1" 30 | export PS1 31 | unset _OLD_ENVIRONMENT_PS1 32 | fi 33 | 34 | unset VIRTUAL_ENV 35 | unset VIRTUAL_ENV_PROMPT 36 | unset VERILATOR_ROOT 37 | unset GHDL_PREFIX 38 | if [ ! "${1-}" = "nondestructive" ] ; then 39 | # Self destruct! 40 | unset -f deactivate 41 | fi 42 | } 43 | 44 | # unset irrelevant variables 45 | deactivate nondestructive 46 | 47 | if [ -n "${ZSH_VERSION-}" ] ; then 48 | release_current_dir="$(dirname "$0")" 49 | else 50 | release_current_dir="$(dirname "${BASH_SOURCE[0]}")" 51 | fi 52 | 53 | if [[ "$(uname)" == "Darwin" ]]; then 54 | release_topdir_abs="$("$release_current_dir"/libexec/realpath "$release_current_dir")" 55 | else 56 | release_topdir_abs="$(realpath "$release_current_dir")" 57 | fi 58 | 59 | export VIRTUAL_ENV="$release_topdir_abs" 60 | export VIRTUAL_ENV_PROMPT='___BRANDING___' 61 | 62 | _OLD_ENVIRONMENT_PATH="$PATH" 63 | PATH="$release_topdir_abs/bin:$release_topdir_abs/py3bin:$PATH" 64 | export PATH 65 | 66 | # unset PYTHONHOME if set 67 | if ! [ -z "${PYTHONHOME+_}" ] ; then 68 | _OLD_ENVIRONMENT_PYTHONHOME="$PYTHONHOME" 69 | unset PYTHONHOME 70 | fi 71 | 72 | _OLD_ENVIRONMENT_PS1="${PS1-}" 73 | if [ -n "${ZSH_VERSION-}" ] ; then 74 | autoload -U colors && colors 75 | PS1="%{$fg[magenta]%}(${VIRTUAL_ENV_PROMPT})%{$reset_color%} ${PS1-}" 76 | else 77 | PS1="\[\033[1;35m\]\342\246\227${VIRTUAL_ENV_PROMPT}\342\246\230\[\033[0m\] ${PS1-}" 78 | fi 79 | export PS1 80 | 81 | export VERILATOR_ROOT="$release_topdir_abs/share/verilator" 82 | export GHDL_PREFIX="$release_topdir_abs/lib/ghdl" 83 | 84 | # This should detect bash and zsh, which have a hash command that must 85 | # be called to get it to forget past commands. Without forgetting 86 | # past commands the $PATH changes we made may not be respected 87 | if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then 88 | hash -r 2>/dev/null 89 | fi 90 | -------------------------------------------------------------------------------- /default/patches/environment.bat: -------------------------------------------------------------------------------- 1 | :: Find root dir 2 | @if not defined YOSYSHQ_ROOT ( 3 | for /f %%i in ("%~dp0") do @set YOSYSHQ_ROOT=%%~fi 4 | ) 5 | 6 | @set prompt=[___BRANDING___] $p$g 7 | @set SSL_CERT_FILE=%YOSYSHQ_ROOT%etc\cacert.pem 8 | 9 | @set PATH=%YOSYSHQ_ROOT%bin;%YOSYSHQ_ROOT%lib;%PATH% 10 | @set PYTHON_EXECUTABLE=%YOSYSHQ_ROOT%lib\python3.exe 11 | @set QT_PLUGIN_PATH=%YOSYSHQ_ROOT%lib\qt5\plugins 12 | @set QT_LOGGING_RULES=*=false 13 | 14 | @set GTK_EXE_PREFIX=%YOSYSHQ_ROOT% 15 | @set GTK_DATA_PREFIX=%YOSYSHQ_ROOT% 16 | @set GDK_PIXBUF_MODULEDIR=%YOSYSHQ_ROOT%lib\gdk-pixbuf-2.0\2.10.0\loaders 17 | @set GDK_PIXBUF_MODULE_FILE=%YOSYSHQ_ROOT%lib\gdk-pixbuf-2.0\2.10.0\loaders.cache 18 | @gdk-pixbuf-query-loaders.exe --update-cache 19 | 20 | @set OPENFPGALOADER_SOJ_DIR=%YOSYSHQ_ROOT%share\openFPGALoader 21 | -------------------------------------------------------------------------------- /default/patches/environment.fish: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env fish 2 | 3 | function deactivate -d "Deactivate the ___BRANDING___ virtual environment" 4 | 5 | if set --query _OLD_ENVIRONMENT_PATH 6 | set --export PATH $_OLD_ENVIRONMENT_PATH 7 | set --erase _OLD_ENVIRONMENT_PATH 8 | end 9 | 10 | if set --query _OLD_ENVIRONMENT_PYTHONHOME 11 | set --export PYTHONHOME $_OLD_ENVIRONMENT_PYTHONHOME 12 | set --erase _OLD_ENVIRONMENT_PYTHONHOME 13 | end 14 | 15 | set --erase VIRTUAL_ENV 16 | set --erase VIRTUAL_ENV_PROMPT 17 | set --erase VERILATOR_ROOT 18 | set --erase GHDL_PREFIX 19 | 20 | if functions --query _old_environment_fish_prompt 21 | functions --erase fish_prompt 22 | functions --copy _old_environment_fish_prompt fish_prompt 23 | functions --erase _old_environment_fish_prompt 24 | end 25 | 26 | if test (count $argv) -eq 0; or test $argv[1] != "nondestructive" 27 | functions --erase deactivate 28 | end 29 | 30 | end 31 | 32 | deactivate nondestructive 33 | 34 | set --local release_current_dir (dirname (status -f)) 35 | 36 | if test (uname) = "Darwin" 37 | set --global release_topdir_abs ($release_current_dir/libexec/realpath $release_current_dir) 38 | else 39 | set --global release_topdir_abs (realpath $release_current_dir) 40 | end 41 | 42 | set --export VIRTUAL_ENV "$release_topdir_abs" 43 | set --export VIRTUAL_ENV_PROMPT '___BRANDING___' 44 | 45 | set --global _OLD_ENVIRONMENT_PATH "$PATH" 46 | set --export PATH "$release_topdir_abs/bin:$release_topdir_abs/py3bin:$PATH" 47 | 48 | if set --query PYTHONHOME 49 | set --export _OLD_ENVIRONMENT_PYTHONHOME "$PYTHONHOME" 50 | set --erase PYTHONHOME 51 | end 52 | 53 | functions --copy fish_prompt _old_environment_fish_prompt 54 | function fish_prompt -d "Write out the prompt" 55 | set_color magenta 56 | echo -n -s '(' $VIRTUAL_ENV_PROMPT ') ' 57 | set_color normal 58 | _old_environment_fish_prompt 59 | end 60 | 61 | set --export VERILATOR_ROOT "$release_topdir_abs/share/verilator" 62 | set --export GHDL_PREFIX "$release_topdir_abs/lib/ghdl" 63 | -------------------------------------------------------------------------------- /default/patches/environment.ps1: -------------------------------------------------------------------------------- 1 | # Find root dir 2 | if (-not $env:YOSYSHQ_ROOT) { 3 | $env:YOSYSHQ_ROOT = Join-Path (Get-Item -Path $PSScriptRoot).FullName "\" 4 | } 5 | 6 | # Set prompt 7 | function Prompt { 8 | "[___BRANDING___] PS " + $(Get-Location) + "> " 9 | } 10 | 11 | # Set environment variables 12 | $env:SSL_CERT_FILE = Join-Path $env:YOSYSHQ_ROOT "etc\cacert.pem" 13 | $env:PATH = "$($env:YOSYSHQ_ROOT)bin;$($env:YOSYSHQ_ROOT)lib;$env:PATH" 14 | $env:PYTHON_EXECUTABLE = Join-Path $env:YOSYSHQ_ROOT "lib\python3.exe" 15 | $env:QT_PLUGIN_PATH = Join-Path $env:YOSYSHQ_ROOT "lib\qt5\plugins" 16 | $env:QT_LOGGING_RULES = "*=false" 17 | $env:GTK_EXE_PREFIX = $env:YOSYSHQ_ROOT 18 | $env:GTK_DATA_PREFIX = $env:YOSYSHQ_ROOT 19 | $env:GDK_PIXBUF_MODULEDIR = Join-Path $env:YOSYSHQ_ROOT "lib\gdk-pixbuf-2.0\2.10.0\loaders" 20 | $env:GDK_PIXBUF_MODULE_FILE = Join-Path $env:YOSYSHQ_ROOT "lib\gdk-pixbuf-2.0\2.10.0\loaders.cache" 21 | 22 | # Update GDK pixbuf loaders cache 23 | & "$env:YOSYSHQ_ROOT\lib\gdk-pixbuf-query-loaders.exe" --update-cache 24 | 25 | # Additional environment variable 26 | $env:OPENFPGALOADER_SOJ_DIR = Join-Path $env:YOSYSHQ_ROOT "share\openFPGALoader" 27 | -------------------------------------------------------------------------------- /default/patches/fonts.conf.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TARGET_DIR/share/fonts 5 | 6 | 7 | mono 8 | 9 | 10 | monospace 11 | 12 | 13 | 14 | 15 | sans serif 16 | 17 | 18 | sans-serif 19 | 20 | 21 | 22 | 23 | sans 24 | 25 | 26 | sans-serif 27 | 28 | 29 | conf.d 30 | /tmp/yosyshq/cache/fontconfig 31 | 32 | 33 | 30 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /default/patches/get-antlr-3.4: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | source "$(dirname "$0")/get-script-header.sh" 4 | ANTLR_HOME_DIR="$DEPS_DIR/antlr-3.4" 5 | rm -rf "$ANTLR_HOME_DIR" 6 | 7 | while :; do 8 | case $1 in 9 | --host=?*) 10 | host=${1#*=} 11 | ANTLR_CONFIGURE_ARGS="--host=$host" 12 | MACHINE_TYPE="$(echo "$host" | cut -d '-' -f 1)" 13 | echo "Using MACHINE_TYPE=$MACHINE_TYPE for --host=$host" 14 | ;; 15 | --host=) 16 | echo "Error: empty --host=" 17 | exit 1 18 | ;; 19 | *) 20 | break 21 | esac 22 | shift 23 | done 24 | 25 | [ -z "${BUILD_TYPE}" ] && BUILD_TYPE="--disable-shared --enable-static" 26 | [ -z "${MACHINE_TYPE}" ] && MACHINE_TYPE="$(uname -m)" 27 | 28 | mkdir -p "$INSTALL_DIR/share/java" 29 | webget \ 30 | "https://www.antlr3.org/download/antlr-3.4-complete.jar" \ 31 | "$INSTALL_DIR/share/java/antlr-3.4-complete.jar" 32 | 33 | mkdir -p "$ANTLR_HOME_DIR/bin" 34 | tee "$ANTLR_HOME_DIR/bin/antlr3" < config.sub.new 53 | mv config.sub.new config.sub 54 | 55 | # Make antlr3debughandlers.c empty to avoid unreferenced symbols 56 | rm -rf src/antlr3debughandlers.c && touch src/antlr3debughandlers.c 57 | 58 | # Enable 64-bit build 59 | if [[ "${MACHINE_TYPE}" == *"64" ]]; then 60 | ANTLR_CONFIGURE_ARGS="$ANTLR_CONFIGURE_ARGS --enable-64bit" 61 | echo "============== WARNING ====================" 62 | echo "The script guessed that this machine is 64 bit." 63 | echo "If ANTLR should be built as 32 bit \(i.e. -m32\)," 64 | echo "please rerun the script as" 65 | echo " MACHINE_TYPE=\"x86\" ./get-antlr-3.4" 66 | else 67 | echo "============== WARNING ====================" 68 | echo "The script guessed that this machine is 32 bit." 69 | echo "If ANTLR should be built as 64 bit \(i.e. -m64\)," 70 | echo "please rerun the script as" 71 | echo " MACHINE_TYPE=\"x86_64\" ./get-antlr-3.4" 72 | fi 73 | 74 | # Build static ANTLR library 75 | 76 | ./configure --disable-antlrdebug --prefix="$INSTALL_DIR" $ANTLR_CONFIGURE_ARGS $BUILD_TYPE 77 | 78 | cp Makefile Makefile.orig 79 | sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig > Makefile 80 | make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" LDFLAGS="${MAKE_LDFLAGS}" 81 | make install 82 | 83 | # Find and move the static build 84 | rename_installed_lib "libantlr3c.a" "libantlr3c-static.a" 85 | 86 | # Build shared ANTLR library 87 | make clean 88 | 89 | ./configure --with-pic --disable-antlrdebug --prefix="$INSTALL_DIR" $ANTLR_CONFIGURE_ARGS $BUILD_TYPE 90 | 91 | cp Makefile Makefile.orig 92 | sed 's,^\(CFLAGS = .*\),\1 -fexceptions,' Makefile.orig > Makefile 93 | make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" LDFLAGS="${MAKE_LDFLAGS}" 94 | make install 95 | rename_installed_lib "libantlr3c.la" "libantlr3c.la.orig" 96 | 97 | LIB_DIR=$(guess_lib_dir "libantlr3c.la.orig") 98 | awk '/^old_library=/ {print "old_library='\''libantlr3c-static.a'\''"} /^library_names=/ {print "library_names='\''libantlr3c.a'\''"} !/^old_library=/ && !/^library_names=/ {print}' < "$LIB_DIR/libantlr3c.la.orig" > "$LIB_DIR/libantlr3c.la" 99 | rm "$LIB_DIR/libantlr3c.la.orig" 100 | 101 | echo 102 | echo ===================== Now configure CVC4 with ===================== 103 | echo ./configure.sh 104 | -------------------------------------------------------------------------------- /default/patches/graphviz_fix.diff: -------------------------------------------------------------------------------- 1 | diff --git a/lib/cgraph/cgraph.h b/lib/cgraph/cgraph.h 2 | index adc58d750..cb1df2bfe 100644 3 | --- a/lib/cgraph/cgraph.h 4 | +++ b/lib/cgraph/cgraph.h 5 | @@ -21,15 +21,7 @@ 6 | extern "C" { 7 | #endif 8 | 9 | -#ifdef _WIN32 10 | -# ifdef EXPORT_CGRAPH 11 | -# define CGRAPH_API __declspec(dllexport) 12 | -# else 13 | -# define CGRAPH_API __declspec(dllimport) 14 | -# endif 15 | -#else 16 | -# define CGRAPH_API extern 17 | -#endif 18 | +#define CGRAPH_API extern 19 | 20 | #ifndef FALSE 21 | #define FALSE (0) 22 | diff --git a/lib/gvpr/Makefile.am b/lib/gvpr/Makefile.am 23 | index ac3c0980f..260b975c5 100644 24 | --- a/lib/gvpr/Makefile.am 25 | +++ b/lib/gvpr/Makefile.am 26 | @@ -21,7 +21,6 @@ AM_CPPFLAGS = \ 27 | -DDFLT_GVPRPATH="\".$(PATH_SEPARATOR)$(pkgdatadir)/gvpr\"" 28 | 29 | pkginclude_HEADERS = gvpr.h 30 | -noinst_PROGRAMS = mkdefs 31 | noinst_HEADERS = actions.h compile.h gprstate.h parse.h queue.h trieFA.h trie.c 32 | noinst_LTLIBRARIES = libgvpr_C.la 33 | lib_LTLIBRARIES = libgvpr.la 34 | @@ -54,11 +53,10 @@ if WITH_WIN32 35 | libgvpr_la_LDFLAGS += -export-symbols-regex gvpr 36 | endif 37 | 38 | -mkdefs_SOURCES = mkdefs.c 39 | 40 | -gdefs.h: $(top_srcdir)/lib/gvpr/gprdata mkdefs$(EXEEXT) 41 | +gdefs.h: $(top_srcdir)/lib/gvpr/gprdata 42 | ./mkdefs$(EXEEXT) gdefs.h < $(top_srcdir)/lib/gvpr/gprdata 43 | 44 | -EXTRA_DIST = $(man_MANS) $(pdf_DATA) gprdata mkdefs.c gdefs.h trie.c gvprlib.vcxproj* 45 | +EXTRA_DIST = $(man_MANS) $(pdf_DATA) gprdata gdefs.h trie.c gvprlib.vcxproj* 46 | 47 | -DISTCLEANFILES = $(pdf_DATA) gdefs.h mkdefs$(EXEEXT) 48 | +DISTCLEANFILES = $(pdf_DATA) gdefs.h 49 | diff --git a/plugin/neato_layout/Makefile.am b/plugin/neato_layout/Makefile.am 50 | index 3f642b128..66a6f6882 100644 51 | --- a/plugin/neato_layout/Makefile.am 52 | +++ b/plugin/neato_layout/Makefile.am 53 | @@ -45,7 +45,6 @@ libgvplugin_neato_layout_C_la_LIBADD += $(top_builddir)/lib/sfdpgen/libsfdpgen_C 54 | endif 55 | 56 | if WITH_WIN32 57 | -libgvplugin_neato_layout_la_LDFLAGS += -no-undefined -export-symbols $(top_srcdir)/plugin/neato_layout/gvplugin_neato_layout.def 58 | libgvplugin_neato_layout_la_LIBADD += $(top_builddir)/lib/cgraph/libcgraph.la $(top_builddir)/lib/cdt/libcdt.la 59 | endif 60 | 61 | -------------------------------------------------------------------------------- /default/patches/openocd.diff: -------------------------------------------------------------------------------- 1 | diff --git a/tcl/board/digilent_arty.cfg b/tcl/board/digilent_arty.cfg 2 | new file mode 100644 3 | index 00000000..317e7d26 4 | --- /dev/null 5 | +++ tcl/board/digilent_arty.cfg 6 | @@ -0,0 +1,22 @@ 7 | +# 8 | +# Digilent Arty with Xilinx Artix-7 FPGA 9 | +# 10 | +# http://store.digilentinc.com/arty-artix-7-fpga-development-board-for-makers-and-hobbyists/ 11 | +# 12 | + 13 | +# iManufacturer 1 Digilent 14 | +# iProduct 2 Digilent USB Device 15 | +# iSerial 3 210319A28C7F 16 | + 17 | +interface ftdi 18 | +ftdi_device_desc "Digilent USB Device" 19 | +ftdi_vid_pid 0x0403 0x6010 20 | +# channel 1 does not have any functionality 21 | +ftdi_channel 0 22 | +# just TCK TDI TDO TMS, no reset 23 | +ftdi_layout_init 0x0088 0x008b 24 | +reset_config none 25 | +adapter_khz 10000 26 | + 27 | +source [find cpld/xilinx-xc7.cfg] 28 | +source [find cpld/jtagspi.cfg] 29 | diff --git a/tcl/board/digilent_cmod_a7.cfg b/tcl/board/digilent_cmod_a7.cfg 30 | new file mode 100644 31 | index 00000000..317e7d26 32 | --- /dev/null 33 | +++ tcl/board/digilent_cmod_a7.cfg 34 | @@ -0,0 +1,22 @@ 35 | +# 36 | +# Digilent CMOD A7 with Xilinx Artix-7 FPGA 37 | +# 38 | +# http://store.digilentinc.com/cmod-a7-breadboardable-artix-7-fpga-module/ 39 | +# 40 | + 41 | +# iManufacturer 0 Digilent 42 | +# iProduct 2 Digilent Adept USB Device 43 | +# iSerial 3 210328A58896 44 | + 45 | +interface ftdi 46 | +ftdi_device_desc "Digilent Adept USB Device" 47 | +ftdi_vid_pid 0x0403 0x6010 48 | +# channel 1 does not have any functionality 49 | +ftdi_channel 0 50 | +# just TCK TDI TDO TMS, no reset 51 | +ftdi_layout_init 0x0088 0x008b 52 | +reset_config none 53 | +adapter_khz 10000 54 | + 55 | +source [find cpld/xilinx-xc7.cfg] 56 | +source [find cpld/jtagspi.cfg] 57 | diff --git a/tcl/cpld/xilinx-xc6s.cfg b/tcl/cpld/xilinx-xc6s.cfg 58 | index 9ce7ad49..cba7cb0f 100644 59 | --- a/tcl/cpld/xilinx-xc6s.cfg 60 | +++ b/tcl/cpld/xilinx-xc6s.cfg 61 | @@ -88,3 +88,9 @@ proc xc6s_print_dna {tap} { 62 | 63 | puts [format "DNA = %57b (0x%x)\n" $hex_dna $hex_dna] 64 | } 65 | + 66 | +proc fpga_program {} { 67 | + global _CHIPNAME 68 | + xc6s_print_dna $_CHIPNAME.tap 69 | + xc6s_program $_CHIPNAME.tap 70 | +} 71 | diff --git a/tcl/cpld/xilinx-xc7.cfg b/tcl/cpld/xilinx-xc7.cfg 72 | index d5824f8a..2be7920c 100644 73 | --- a/tcl/cpld/xilinx-xc7.cfg 74 | +++ b/tcl/cpld/xilinx-xc7.cfg 75 | @@ -55,3 +55,8 @@ proc xc7_program {tap} { 76 | irscan $tap $XC7_BYPASS 77 | runtest 2000 78 | } 79 | + 80 | +proc fpga_program {} { 81 | + global _CHIPNAME 82 | + xc7_program $_CHIPNAME.tap 83 | +} 84 | diff --git a/tcl/board/gadgetfactory_papilio_duo.cfg b/tcl/board/gadgetfactory_papilio_duo.cfg 85 | new file mode 100644 86 | index 0000000..0307779 87 | --- /dev/null 88 | +++ tcl/board/gadgetfactory_papilio_duo.cfg 89 | @@ -0,0 +1,20 @@ 90 | +# 91 | +# Papilio DUO 92 | +# 93 | +# http://papilio.cc/index.php?n=Papilio.PapilioDUOHardwareGuide 94 | +# 95 | + 96 | +# iManufacturer 1 Gadget Factory 97 | +# iProduct 2 Papilio DUO 98 | + 99 | +interface ftdi 100 | +ftdi_device_desc "Papilio DUO" 101 | +ftdi_vid_pid 0x0403 0x7bc0 102 | +ftdi_channel 0 103 | +# just TCK TDI TDO TMS, no reset 104 | +ftdi_layout_init 0x0008 0x000b 105 | +reset_config none 106 | +adapter_khz 10000 107 | + 108 | +source [find cpld/xilinx-xc6s.cfg] 109 | +source [find cpld/jtagspi.cfg] 110 | diff --git a/tcl/board/numato_neso.cfg b/tcl/board/numato_neso.cfg 111 | new file mode 100644 112 | index 0000000..37b18a0 113 | --- /dev/null 114 | +++ tcl/board/numato_neso.cfg 115 | @@ -0,0 +1,30 @@ 116 | +# 117 | +# Numato Neso - Artix 7 FPGA Board 118 | +# 119 | +# https://numato.com/neso-artix-7-fpga-development-board 120 | +# 121 | +# IMPORTANT: 122 | +# To use openocd with Neso using its onboard FTDI chip, 123 | +# put the jumpers P10 and P11 in following configuration: 124 | +# 125 | +# P10: Jumpers one each between 2-4 and 3-5 126 | +# P11: Jumpers one each between 2-4 and 3-5 127 | +# 128 | +# NOTE: 129 | +# To put the jumpers configuration back to factory configuration (SPI flash connnections): 130 | +# 131 | +# P10: Jumpers one each between 1-2 and 5-6 132 | +# P11: Jumpers one each between 1-2 and 5-6 133 | + 134 | +interface ftdi 135 | +ftdi_device_desc "Neso Artix 7 FPGA Module" 136 | +ftdi_vid_pid 0x0403 0x6010 137 | +# channel 1 is for custom purpose by users (like uart, fifo etc) 138 | +ftdi_channel 0 139 | +# just TCK TDI TDO TMS, no reset 140 | +ftdi_layout_init 0x0008 0x000b 141 | +reset_config none 142 | +adapter_khz 10000 143 | + 144 | +source [find cpld/xilinx-xc7.cfg] 145 | +source [find cpld/jtagspi.cfg] 146 | diff --git a/tcl/board/numato_saturn.cfg b/tcl/board/numato_saturn.cfg 147 | new file mode 100644 148 | index 0000000..6597f2a 149 | --- /dev/null 150 | +++ tcl/board/numato_saturn.cfg 151 | @@ -0,0 +1,30 @@ 152 | +# 153 | +# Numato Saturn - Spartan 6 FPGA Development Board With DDR SDRAM 154 | +# 155 | +# https://numato.com/saturn-spartan-6-fpga-development-board-with-ddr-sdram 156 | +# 157 | +# IMPORTANT: 158 | +# To use openocd with Saturn using its onboard FTDI chip, 159 | +# put the jumpers P10 and P11 in following configuration: 160 | +# 161 | +# P10: Jumpers one each between 2-4 and 3-5 162 | +# P11: Jumpers one each between 2-4 and 3-5 163 | +# 164 | +# NOTE: 165 | +# To put the jumpers configuration back to factory configuration (SPI flash connnections): 166 | +# 167 | +# P10: Jumpers one each between 1-2 and 5-6 168 | +# P11: Jumpers one each between 1-2 and 5-6 169 | + 170 | +interface ftdi 171 | +ftdi_device_desc "Saturn Spartan 6 FPGA Module" 172 | +ftdi_vid_pid 0x0403 0x6010 173 | +# channel 1 is for custom purpose by users (like uart, fifo etc) 174 | +ftdi_channel 0 175 | +# just TCK TDI TDO TMS, no reset 176 | +ftdi_layout_init 0x0008 0x000b 177 | +reset_config none 178 | +adapter_khz 10000 179 | + 180 | +source [find cpld/xilinx-xc6s.cfg] 181 | +source [find cpld/jtagspi.cfg] 182 | diff --git a/tcl/board/numato_waxwing.cfg b/tcl/board/numato_waxwing.cfg 183 | new file mode 100644 184 | index 0000000..328e1e5 185 | --- /dev/null 186 | +++ tcl/board/numato_waxwing.cfg 187 | @@ -0,0 +1,30 @@ 188 | +# 189 | +# Numato Waxwing Spartan 6 FPGA Development Board 190 | +# 191 | +# https://numato.com/waxwing-spartan-6-fpga-development-board 192 | +# 193 | +# IMPORTANT: 194 | +# To use openocd with Waxwing using its onboard FTDI chip, 195 | +# put the jumpers P12 and P13 in following configuration: 196 | +# 197 | +# P12: Jumpers one each between 2-4 and 3-5 198 | +# P13: Jumpers one each between 2-4 and 3-5 199 | +# 200 | +# NOTE: 201 | +# To put the jumpers configuration back to factory configuration (SPI flash connnections): 202 | +# 203 | +# P12: Jumpers one each between 1-2 and 5-6 204 | +# P13: Jumpers one each between 1-2 and 5-6 205 | + 206 | +interface ftdi 207 | +ftdi_device_desc "Waxwing Spartan 6 FPGA Board" 208 | +ftdi_vid_pid 0x0403 0x6010 209 | +# channel 1 is for custom purpose by users (like uart, fifo etc) 210 | +ftdi_channel 0 211 | +# just TCK TDI TDO TMS, no reset 212 | +ftdi_layout_init 0x0008 0x000b 213 | +reset_config none 214 | +adapter_khz 10000 215 | + 216 | +source [find cpld/xilinx-xc6s.cfg] 217 | +source [find cpld/jtagspi.cfg] 218 | -------------------------------------------------------------------------------- /default/patches/python27.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Modules/main.c b/Modules/main.c 2 | index a6edf822d0..b193e7f835 100644 3 | --- a/Modules/main.c 4 | +++ b/Modules/main.c 5 | @@ -531,7 +531,7 @@ Py_Main(int argc, char **argv) 6 | } 7 | #endif /* __VMS */ 8 | 9 | -#ifdef __APPLE__ 10 | +//#ifdef __APPLE__ 11 | /* On MacOS X, when the Python interpreter is embedded in an 12 | application bundle, it gets executed by a bootstrapping script 13 | that does os.execve() with an argv[0] that's different from the 14 | @@ -545,9 +545,9 @@ Py_Main(int argc, char **argv) 15 | Py_SetProgramName(p); 16 | else 17 | Py_SetProgramName(argv[0]); 18 | -#else 19 | - Py_SetProgramName(argv[0]); 20 | -#endif 21 | +//#else 22 | +// Py_SetProgramName(argv[0]); 23 | +//#endif 24 | Py_Initialize(); 25 | 26 | if (Py_VerboseFlag || 27 | --- a/Makefile.pre.in 28 | +++ b/Makefile.pre.in 29 | @@ -509,6 +509,9 @@ pybuilddir.txt: $(BUILDPYTHON) 30 | rm -f ./pybuilddir.txt ; \ 31 | exit 1 ; \ 32 | fi 33 | + echo `cat pybuilddir.txt`/sysconfigdata > pysysconfigdatadir.txt 34 | + mkdir -p `cat pysysconfigdatadir.txt` 35 | + cp `cat pybuilddir.txt`/_sysconfigdata.py `cat pysysconfigdatadir.txt` 36 | 37 | # This is shared by the math and cmath modules 38 | Modules/_math.o: Modules/_math.c Modules/_math.h 39 | @@ -1097,7 +1100,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c 40 | else true; \ 41 | fi; \ 42 | done 43 | - @for i in $(srcdir)/Lib/*.py `cat pybuilddir.txt`/_sysconfigdata.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \ 44 | + @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \ 45 | do \ 46 | if test -x $$i; then \ 47 | $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \ 48 | @@ -1107,6 +1110,11 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c 49 | echo $(INSTALL_DATA) $$i $(LIBDEST); \ 50 | fi; \ 51 | done 52 | + $(INSTALL_DATA) `cat pysysconfigdatadir.txt`/_sysconfigdata.py \ 53 | + $(DESTDIR)$(LIBDEST) 54 | + mkdir -p $(DESTDIR)$(LIBDEST)/sysconfigdata 55 | + $(INSTALL_DATA) `cat pysysconfigdatadir.txt`/_sysconfigdata.py \ 56 | + $(DESTDIR)$(LIBDEST)/sysconfigdata 57 | @for d in $(LIBSUBDIRS); \ 58 | do \ 59 | a=$(srcdir)/Lib/$$d; \ 60 | @@ -1432,7 +1440,7 @@ distclean: clobber 61 | Modules/Setup Modules/Setup.local Modules/Setup.config \ 62 | Modules/ld_so_aix Modules/python.exp Misc/python.pc 63 | -rm -f python*-gdb.py 64 | - -rm -f pybuilddir.txt 65 | + -rm -f pybuilddir.txt pysysconfigdatadir.txt 66 | # Issue #28258: set LC_ALL to avoid issues with Estonian locale. 67 | # Expansion is performed here by shell (spawned by make) itself before 68 | # arguments are passed to find. So LC_ALL=C must be set as a separate 69 | diff --git a/configure.ac b/configure.ac 70 | index efe6922..6845eab 100644 71 | --- a/configure.ac 72 | +++ b/configure.ac 73 | @@ -36,7 +36,7 @@ if test "$cross_compiling" = yes; then 74 | AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found]) 75 | fi 76 | AC_MSG_RESULT($interp) 77 | - PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp 78 | + PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pysysconfigdatadir.txt && echo $(abs_builddir)/`cat pysysconfigdatadir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp 79 | fi 80 | elif test "$cross_compiling" = maybe; then 81 | AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH]) 82 | diff --git a/configure b/configure 83 | index 63d6753..3f7a3d2 100755 84 | --- a/configure 85 | +++ b/configure 86 | @@ -2964,7 +2964,7 @@ $as_echo_n "checking for python interpreter for cross build... " >&6; } 87 | fi 88 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5 89 | $as_echo "$interp" >&6; } 90 | - PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp 91 | + PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pysysconfigdatadir.txt && echo $(abs_builddir)/`cat pysysconfigdatadir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp 92 | fi 93 | elif test "$cross_compiling" = maybe; then 94 | as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5 95 | -------------------------------------------------------------------------------- /default/patches/python3.11.6-darwin.diff: -------------------------------------------------------------------------------- 1 | diff --git a/configure.ac b/configure.ac 2 | index e1cbb7c7fb..9e2db62443 100644 3 | --- a/configure.ac 4 | +++ b/configure.ac 5 | @@ -542,6 +542,9 @@ then 6 | *-*-linux*) 7 | ac_sys_system=Linux 8 | ;; 9 | + *-*-darwin*) 10 | + ac_sys_system=Darwin 11 | + ;; 12 | *-*-cygwin*) 13 | ac_sys_system=Cygwin 14 | ;; 15 | @@ -597,6 +600,15 @@ if test "$cross_compiling" = yes; then 16 | _host_cpu=$host_cpu 17 | esac 18 | ;; 19 | + *-*-darwin*) 20 | + case "$host_cpu" in 21 | + arm*) 22 | + _host_cpu=arm 23 | + ;; 24 | + *) 25 | + _host_cpu=$host_cpu 26 | + esac 27 | + ;; 28 | *-*-cygwin*) 29 | _host_cpu= 30 | ;; 31 | @@ -1625,17 +1637,6 @@ then 32 | ARFLAGS="rcs" 33 | fi 34 | 35 | -AC_CHECK_TOOLS([READELF], [readelf], [:]) 36 | -if test "$cross_compiling" = yes; then 37 | - case "$READELF" in 38 | - readelf|:) 39 | - AC_MSG_ERROR([readelf for the host is required for cross builds]) 40 | - ;; 41 | - esac 42 | -fi 43 | -AC_SUBST(READELF) 44 | - 45 | - 46 | case $MACHDEP in 47 | hp*|HP*) 48 | # install -d does not work on HP-UX 49 | @@ -2944,54 +2945,8 @@ case $ac_sys_system/$ac_sys_release in 50 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; 51 | Darwin/*) 52 | gcc_version=`gcc -dumpversion` 53 | - if test ${gcc_version} '<' 4.0 54 | - then 55 | - LIBTOOL_CRUFT="-lcc_dynamic" 56 | - else 57 | - LIBTOOL_CRUFT="" 58 | - fi 59 | - AC_RUN_IFELSE([AC_LANG_SOURCE([[ 60 | - #include 61 | - int main(int argc, char*argv[]) 62 | - { 63 | - if (sizeof(long) == 4) { 64 | - return 0; 65 | - } else { 66 | - return 1; 67 | - } 68 | - } 69 | - ]])],[ac_osx_32bit=yes],[ac_osx_32bit=no],[ac_osx_32bit=yes]) 70 | - 71 | - if test "${ac_osx_32bit}" = "yes"; then 72 | - case `/usr/bin/arch` in 73 | - i386) 74 | - MACOSX_DEFAULT_ARCH="i386" 75 | - ;; 76 | - ppc) 77 | - MACOSX_DEFAULT_ARCH="ppc" 78 | - ;; 79 | - *) 80 | - AC_MSG_ERROR([Unexpected output of 'arch' on macOS]) 81 | - ;; 82 | - esac 83 | - else 84 | - case `/usr/bin/arch` in 85 | - i386) 86 | - MACOSX_DEFAULT_ARCH="x86_64" 87 | - ;; 88 | - ppc) 89 | - MACOSX_DEFAULT_ARCH="ppc64" 90 | - ;; 91 | - arm64) 92 | - MACOSX_DEFAULT_ARCH="arm64" 93 | - ;; 94 | - *) 95 | - AC_MSG_ERROR([Unexpected output of 'arch' on macOS]) 96 | - ;; 97 | - esac 98 | - 99 | - fi 100 | 101 | + MACOSX_DEFAULT_ARCH="x86_64" 102 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}" 103 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' 104 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; 105 | @@ -4598,10 +4553,10 @@ AC_CHECK_FUNCS([ \ 106 | mknod mknodat mktime mmap mremap nice openat opendir pathconf pause pipe \ 107 | pipe2 plock poll posix_fadvise posix_fallocate posix_spawn posix_spawnp \ 108 | pread preadv preadv2 pthread_condattr_setclock pthread_init pthread_kill \ 109 | - pwrite pwritev pwritev2 readlink readlinkat readv realpath renameat \ 110 | + pwrite pwritev2 readlink readlinkat readv realpath renameat \ 111 | rtpSpawn sched_get_priority_max sched_rr_get_interval sched_setaffinity \ 112 | sched_setparam sched_setscheduler sem_clockwait sem_getvalue sem_open \ 113 | - sem_timedwait sem_unlink sendfile setegid seteuid setgid sethostname \ 114 | + sem_timedwait sem_unlink setegid seteuid setgid sethostname \ 115 | setitimer setlocale setpgid setpgrp setpriority setregid setresgid \ 116 | setresuid setreuid setsid setuid setvbuf shutdown sigaction sigaltstack \ 117 | sigfillset siginterrupt sigpending sigrelse sigtimedwait sigwait \ 118 | -------------------------------------------------------------------------------- /default/patches/python3_package.sh: -------------------------------------------------------------------------------- 1 | function python3_package_setup { 2 | export _PYTHON_PROJECT_BASE=${BUILD_DIR}/python3${INSTALL_PREFIX} 3 | export PYTHONHOME=${BUILD_DIR}/python3-native${INSTALL_PREFIX} 4 | export PYTHONPATH=${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python3.11/site-packages:${BUILD_DIR}/python3${INSTALL_PREFIX}/lib/python3.11:${BUILD_DIR}/python3${INSTALL_PREFIX}/lib/python3.11/site-packages 5 | export PYTHON3_NATIVE=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin/python3.11 6 | cp ${_PYTHON_PROJECT_BASE}/lib/python3.11/_sysconfigdata__* ${PYTHONHOME}/lib/python3.11/. 7 | if [ ${ARCH} == 'linux-arm64' ]; then 8 | sed -i 's,/yosyshq/,'${PYTHONHOME}/',g' ${PYTHONHOME}/lib/python3.11/_sysconfigdata__linux_aarch64-linux-gnu.py 9 | elif [ ${ARCH} == 'linux-x64' ]; then 10 | sed -i 's,/yosyshq/,'${PYTHONHOME}/',g' ${PYTHONHOME}/lib/python3.11/_sysconfigdata__linux_x86_64-linux-gnu.py 11 | elif [ ${ARCH} == 'windows-x64' ]; then 12 | sed -i 's,/yosyshq/,'${PYTHONHOME}/',g' ${PYTHONHOME}/lib/python3.11/_sysconfigdata__win32_.py 13 | elif [ ${ARCH} == 'darwin-x64' ]; then 14 | sed -i 's,/yosyshq/,'${PYTHONHOME}/',g' ${PYTHONHOME}/lib/python3.11/_sysconfigdata__darwin_darwin.py 15 | elif [ ${ARCH} == 'darwin-arm64' ]; then 16 | sed -i 's,/yosyshq/,'${PYTHONHOME}/',g' ${PYTHONHOME}/lib/python3.11/_sysconfigdata__darwin_darwin.py 17 | fi 18 | cp ${PYTHONHOME}/lib/python3.11/_sysconfigdata__* ${_PYTHON_PROJECT_BASE}/lib/python3.11/. 19 | } 20 | 21 | function python3_package_install { 22 | install_cmd="setup.py install --prefix=${OUTPUT_DIR}${INSTALL_PREFIX} $1" 23 | if [ ${ARCH} == 'linux-arm64' ]; then 24 | _PYTHON_HOST_PLATFORM=linux-aarch64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_aarch64-linux-gnu ${PYTHON3_NATIVE} ${install_cmd} 25 | elif [ ${ARCH} == 'linux-x64' ]; then 26 | _PYTHON_HOST_PLATFORM=linux-x64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_x86_64-linux-gnu ${PYTHON3_NATIVE} ${install_cmd} 27 | elif [ ${ARCH} == 'windows-x64' ]; then 28 | _PYTHON_HOST_PLATFORM=mingw-x64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__win32_ ${PYTHON3_NATIVE} ${install_cmd} 29 | elif [ ${ARCH} == 'darwin-x64' ]; then 30 | _PYTHON_HOST_PLATFORM=darwin-x64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__darwin_darwin ${PYTHON3_NATIVE} ${install_cmd} 31 | elif [ ${ARCH} == 'darwin-arm64' ]; then 32 | _PYTHON_HOST_PLATFORM=darwin-aarch64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__darwin_darwin ${PYTHON3_NATIVE} ${install_cmd} 33 | fi 34 | } 35 | 36 | function python3_package_install_numpy { 37 | install_cmd="setup.py install --prefix=${OUTPUT_DIR}${INSTALL_PREFIX} $1" 38 | if [ ${ARCH} == 'linux-arm64' ]; then 39 | _PYTHON_HOST_PLATFORM=linux-aarch64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_aarch64-linux-gnu ${PYTHON3_NATIVE} ${install_cmd} 40 | elif [ ${ARCH} == 'linux-x64' ]; then 41 | _PYTHON_HOST_PLATFORM=linux-x64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_x86_64-linux-gnu ${PYTHON3_NATIVE} ${install_cmd} 42 | elif [ ${ARCH} == 'windows-x64' ]; then 43 | _PYTHON_HOST_PLATFORM=mingw-x64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__win32_ ${PYTHON3_NATIVE} setup.py build --cpu-dispatch="max -avx512f -avx512cd -avx512_knl -avx512_knm -avx512_skx -avx512_clx -avx512_cnl -avx512_icl" install --prefix=${OUTPUT_DIR}${INSTALL_PREFIX} $1 44 | elif [ ${ARCH} == 'darwin-x64' ]; then 45 | _PYTHON_HOST_PLATFORM=darwin-x64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__darwin_darwin ${PYTHON3_NATIVE} ${install_cmd} 46 | elif [ ${ARCH} == 'darwin-arm64' ]; then 47 | _PYTHON_HOST_PLATFORM=darwin-aarch64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__darwin_darwin ${PYTHON3_NATIVE} ${install_cmd} 48 | fi 49 | } 50 | function python3_package_develop { 51 | install_cmd="setup.py develop --prefix=${OUTPUT_DIR}${INSTALL_PREFIX} $1" 52 | if [ ${ARCH} == 'linux-arm64' ]; then 53 | _PYTHON_HOST_PLATFORM=linux-aarch64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_aarch64-linux-gnu ${PYTHON3_NATIVE} ${install_cmd} 54 | elif [ ${ARCH} == 'linux-x64' ]; then 55 | _PYTHON_HOST_PLATFORM=linux-x64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_x86_64-linux-gnu ${PYTHON3_NATIVE} ${install_cmd} 56 | elif [ ${ARCH} == 'windows-x64' ]; then 57 | _PYTHON_HOST_PLATFORM=mingw-x64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__win32_ ${PYTHON3_NATIVE} ${install_cmd} 58 | elif [ ${ARCH} == 'darwin-x64' ]; then 59 | _PYTHON_HOST_PLATFORM=darwin-x64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__darwin_darwin ${PYTHON3_NATIVE} ${install_cmd} 60 | elif [ ${ARCH} == 'darwin-arm64' ]; then 61 | _PYTHON_HOST_PLATFORM=darwin-aarch64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__darwin_darwin ${PYTHON3_NATIVE} ${install_cmd} 62 | fi 63 | } 64 | 65 | function python3_package_pip_install { 66 | install_cmd="-m pip install --target ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python3.11/site-packages --no-cache-dir --disable-pip-version-check $1" 67 | if [ ${ARCH} == 'linux-arm64' ]; then 68 | _PYTHON_HOST_PLATFORM=linux-aarch64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_aarch64-linux-gnu ${PYTHON3_NATIVE} ${install_cmd} 69 | elif [ ${ARCH} == 'linux-x64' ]; then 70 | _PYTHON_HOST_PLATFORM=linux-x64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_x86_64-linux-gnu ${PYTHON3_NATIVE} ${install_cmd} 71 | elif [ ${ARCH} == 'windows-x64' ]; then 72 | _PYTHON_HOST_PLATFORM=mingw-x64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__win32_ ${PYTHON3_NATIVE} ${install_cmd} 73 | elif [ ${ARCH} == 'darwin-x64' ]; then 74 | _PYTHON_HOST_PLATFORM=darwin-x64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__darwin_darwin ${PYTHON3_NATIVE} ${install_cmd} 75 | elif [ ${ARCH} == 'darwin-arm64' ]; then 76 | _PYTHON_HOST_PLATFORM=darwin-aarch64 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__darwin_darwin ${PYTHON3_NATIVE} ${install_cmd} 77 | fi 78 | } 79 | 80 | function python3_package_pth { 81 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/easy_install* 82 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python3.11/site-packages/setuptools.pth 83 | # rename easy-install.pth to prevent conflict with multiple files with same name 84 | mv ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python3.11/site-packages/easy-install.pth ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python3.11/site-packages/$1.pth 85 | } 86 | -------------------------------------------------------------------------------- /default/patches/smt-switch-win32.diff: -------------------------------------------------------------------------------- 1 | diff --git a/btor/src/boolector_term.cpp b/btor/src/boolector_term.cpp 2 | index 19480e7..018bb8d 100644 3 | --- a/btor/src/boolector_term.cpp 4 | +++ b/btor/src/boolector_term.cpp 5 | @@ -26,6 +26,10 @@ extern "C" 6 | #include "assert.h" 7 | #include 8 | #include "stdio.h" 9 | +#include 10 | +#include 11 | +#include 12 | +#include 13 | 14 | // defining hash for old compilers 15 | namespace std 16 | @@ -320,6 +324,34 @@ bool BoolectorTerm::is_value() const 17 | return res; 18 | } 19 | 20 | +FILE *tempfileopen() 21 | +{ 22 | + int fd; 23 | + FILE *fp; 24 | + char tp[MAX_PATH - 13]; 25 | + char fn[MAX_PATH + 1]; 26 | + 27 | + if (!GetTempPathA(sizeof(tp), tp)) 28 | + return NULL; 29 | + 30 | + if (!GetTempFileNameA(tp, "tmpfile", 0, fn)) 31 | + return NULL; 32 | + 33 | + fd = _open(fn, 34 | + _O_CREAT | _O_RDWR | _O_SHORT_LIVED | _O_TEMPORARY | _O_BINARY, 35 | + _S_IREAD | _S_IWRITE); 36 | + if (fd == -1) 37 | + return NULL; 38 | + 39 | + fp = _fdopen(fd, "w+"); 40 | + if (!fp) { 41 | + _close(fd); 42 | + return NULL; 43 | + } 44 | + 45 | + return fp; 46 | +} 47 | + 48 | std::string BoolectorTerm::to_string() 49 | { 50 | std::string sres; 51 | @@ -353,6 +353,26 @@ std::string BoolectorTerm::to_string() 52 | // won't necessarily use symbol names (might use auxiliary variables) 53 | char * cres; 54 | size_t size; 55 | +#ifdef _WIN32 56 | + FILE * stream = tempfileopen(); 57 | + boolector_dump_smt2_node(btor, stream, node); 58 | + int64_t status = fflush(stream); 59 | + if (status != 0) 60 | + { 61 | + throw InternalSolverException("Error flushing stream for btor to_string"); 62 | + } 63 | + fseek(stream, 0, SEEK_END); 64 | + size = ftell(stream); 65 | + rewind(stream); 66 | + cres = (char *)malloc(size + 1); 67 | + fread(cres, 1, size, stream); 68 | + status = fclose(stream); 69 | + if (status != 0) 70 | + { 71 | + throw InternalSolverException("Error closing stream for btor to_string"); 72 | + } 73 | + cres[size] = 0; 74 | +#else 75 | FILE * stream = open_memstream(&cres, &size); 76 | boolector_dump_smt2_node(btor, stream, node); 77 | int64_t status = fflush(stream); 78 | @@ -365,6 +385,7 @@ std::string BoolectorTerm::to_string() 79 | { 80 | throw InternalSolverException("Error closing stream for btor to_string"); 81 | } 82 | +#endif 83 | sres = cres; 84 | free(cres); 85 | return sres; 86 | -------------------------------------------------------------------------------- /default/patches/start.bat: -------------------------------------------------------------------------------- 1 | @cmd /k "%~dp0\environment.bat" 2 | -------------------------------------------------------------------------------- /default/patches/suprove.diff: -------------------------------------------------------------------------------- 1 | diff --git a/abc-zz/ZZ/Bip/Main_bip.cc b/abc-zz/ZZ/Bip/Main_bip.cc 2 | index 9b2c350..f6ddc84 100644 3 | --- a/abc-zz/ZZ/Bip/Main_bip.cc 4 | +++ b/abc-zz/ZZ/Bip/Main_bip.cc 5 | @@ -1097,7 +1097,7 @@ int main(int argc, char** argv) 6 | bool old_sif = cli.get("old-sif").bool_val; 7 | 8 | if (!cli.get("fpu").bool_val){ 9 | - #if defined(__linux__) 10 | + #if defined(__linux__) && defined(__x86_64__) 11 | fpu_control_t oldcw, newcw; 12 | _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw); 13 | #endif 14 | diff --git a/abc-zz/ZZ/Prelude/Profile.ihh b/abc-zz/ZZ/Prelude/Profile.ihh 15 | index 3b173e8..4f1876f 100644 16 | --- a/abc-zz/ZZ/Prelude/Profile.ihh 17 | +++ b/abc-zz/ZZ/Prelude/Profile.ihh 18 | @@ -65,7 +65,7 @@ extern bool suppress_profile_output; // -- defaults to TRUE 19 | // Inline assembler for getting cycle counter: 20 | 21 | 22 | -#if defined(__linux__) 23 | +#if defined(__linux__) && defined(__x86_64__) 24 | #if !defined(ZZ_LP64) 25 | extern __inline__ uint64 rdtsc(void) { 26 | uint64 x; 27 | -------------------------------------------------------------------------------- /default/rules/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /default/rules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YosysHQ/oss-cad-suite-build/72b0fddba33eba30fa9935f67bed40cfbc736fe5/default/rules/__init__.py -------------------------------------------------------------------------------- /default/rules/cocotb.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | SourceLocation( 4 | name = 'cocotb', 5 | vcs = 'git', 6 | location = 'https://github.com/cocotb/cocotb', 7 | revision = 'origin/master', 8 | license_file = 'LICENSE', 9 | ) 10 | 11 | Target( 12 | name = 'cocotb', 13 | dependencies = [ 'python3', 'python3-native' ], 14 | resources = [ 'python3' ], 15 | patches = [ 'python3_package.sh' ], 16 | sources = [ 'cocotb' ], 17 | arch = [ 'linux-x64', 'linux-arm64', 'darwin-x64', 'darwin-arm64' ], 18 | ) 19 | -------------------------------------------------------------------------------- /default/rules/default.py: -------------------------------------------------------------------------------- 1 | from src.base import Target 2 | 3 | Target( 4 | name = 'default', 5 | release_name = 'oss-cad-suite', 6 | top_package = True, 7 | dependencies = [ 8 | 'yosys', 9 | 'formal', 10 | 'imctk', 11 | 'ghdl', 12 | 'ghdl-yosys-plugin', 13 | 'yosys-slang-plugin', 14 | 'nextpnr-generic', 15 | 'nextpnr-ice40', 16 | 'nextpnr-ecp5', 17 | 'nextpnr-machxo2', 18 | 'nextpnr-nexus', 19 | 'nextpnr-himbaechel', 20 | 'icestorm', 21 | 'prjtrellis', 22 | 'prjpeppercorn', 23 | 'prjoxide', 24 | 'apicula', 25 | 'openfpgaloader', 26 | 'aiger', 27 | 'avy', 28 | 'bitwuzla', 29 | 'boolector', 30 | 'cvc4', 31 | 'cvc5', 32 | 'yices', 33 | 'suprove', 34 | 'pono', 35 | 'z3', 36 | 'eqy', 37 | 'gtkwave', 38 | 'verilator', 39 | 'iverilog', 40 | 'python-programmers', 41 | 'utils', 42 | 'pyhdl', 43 | 'cocotb', 44 | ], 45 | branding = 'OSS CAD Suite', 46 | readme = 'README', 47 | resources = [ 'system-resources' ], 48 | ) 49 | 50 | Target( 51 | name = 'default-formal', 52 | release_name = 'oss-cad-suite-formal', 53 | top_package = True, 54 | dependencies = [ 55 | 'yosys', 56 | 'formal', 57 | 'imctk', 58 | 'aiger', 59 | 'avy', 60 | 'bitwuzla', 61 | 'boolector', 62 | 'cvc4', 63 | 'cvc5', 64 | 'yices', 65 | 'suprove', 66 | 'pono', 67 | 'z3', 68 | 'eqy', 69 | 'gtkwave', 70 | ], 71 | branding ='OSS CAD Formal', 72 | readme = 'README', 73 | resources = [ 'system-resources' ], 74 | ) 75 | 76 | Target( 77 | name = 'yosyshq-ci', 78 | release_name = 'oss-cad-suite-ci', 79 | top_package = True, 80 | dependencies = [ 81 | 'imctk', 82 | 'aiger', 83 | 'avy', 84 | 'bitwuzla', 85 | 'boolector', 86 | 'cvc4', 87 | 'cvc5', 88 | 'yices', 89 | 'suprove', 90 | 'pono', 91 | 'z3', 92 | 'iverilog', 93 | ], 94 | branding ='OSS CAD Suite', 95 | readme = 'README', 96 | resources = [ 'system-resources' ], 97 | ) 98 | -------------------------------------------------------------------------------- /default/rules/eqy.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | SourceLocation( 4 | name = 'eqy', 5 | vcs = 'git', 6 | location = 'https://github.com/YosysHQ/eqy', 7 | revision = 'origin/main', 8 | license_file = 'COPYING', 9 | ) 10 | 11 | Target( 12 | name = 'eqy', 13 | sources = [ 'eqy' ], 14 | dependencies = [ 'yosys' ], 15 | resources = [ 'python3' ], 16 | ) 17 | -------------------------------------------------------------------------------- /default/rules/formal.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | SourceLocation( 4 | name = 'mau', 5 | vcs = 'git', 6 | location = 'https://github.com/YosysHQ/mau', 7 | revision = 'origin/main', 8 | license_file = 'COPYING', 9 | ) 10 | 11 | SourceLocation( 12 | name = 'mcy', 13 | vcs = 'git', 14 | location = 'https://github.com/YosysHQ/mcy', 15 | revision = 'origin/main', 16 | license_file = 'COPYING', 17 | ) 18 | 19 | SourceLocation( 20 | name = 'scy', 21 | vcs = 'git', 22 | location = 'https://github.com/YosysHQ/scy', 23 | revision = 'origin/main', 24 | license_file = 'COPYING', 25 | ) 26 | 27 | SourceLocation( 28 | name = 'sby', 29 | vcs = 'git', 30 | location = 'https://github.com/YosysHQ/sby', 31 | revision = 'origin/main', 32 | license_file = 'COPYING', 33 | ) 34 | 35 | SourceLocation( 36 | name = 'sby-gui', 37 | vcs = 'git', 38 | location = 'https://github.com/YosysHQ/sby-gui', 39 | revision = 'origin/main', 40 | license_file = 'COPYING', 41 | ) 42 | 43 | SourceLocation( 44 | name = 'imctk', 45 | vcs = 'git', 46 | location = 'https://github.com/YosysHQ/imctk', 47 | revision = 'origin/main', 48 | license_file = 'COPYRIGHT', 49 | ) 50 | 51 | Target( 52 | name = 'formal', 53 | sources = [ 'mau', 'mcy', 'scy', 'sby', 'sby-gui', 'yosys' ], 54 | dependencies = [ 'python3', 'python3-native' ], 55 | resources = [ 'python3' ], 56 | patches = [ 'python3_package.sh' ], 57 | critical = True, 58 | ) 59 | 60 | Target( 61 | name = 'imctk', 62 | sources = [ 'imctk' ], 63 | ) 64 | -------------------------------------------------------------------------------- /default/rules/ghdl.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | SourceLocation( 4 | name = 'ghdl', 5 | vcs = 'git', 6 | location = 'https://github.com/ghdl/ghdl', 7 | revision = 'origin/master', 8 | license_file = 'COPYING.md', 9 | ) 10 | 11 | Target( 12 | name = 'ghdl', 13 | sources = [ 'ghdl' ], 14 | arch = [ 'linux-x64', 'darwin-x64', 'darwin-arm64' ], 15 | ) 16 | -------------------------------------------------------------------------------- /default/rules/gtkwave.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | SourceLocation( 4 | name = 'gtkwave', 5 | vcs = 'git', 6 | location = 'https://github.com/gtkwave/gtkwave', 7 | revision = '10cfae614ed8be80b5bb64e8c2194e7dffcd297a', 8 | license_file = 'LICENSE', 9 | ) 10 | 11 | Target( 12 | name = 'gtkwave', 13 | sources = [ 'gtkwave' ], 14 | package = 'gtkwave', 15 | ) 16 | -------------------------------------------------------------------------------- /default/rules/iverilog.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | SourceLocation( 4 | name = 'iverilog', 5 | vcs = 'git', 6 | location = 'https://github.com/steveicarus/iverilog', 7 | revision = 'origin/master', 8 | license_file = 'COPYING', 9 | ) 10 | 11 | Target( 12 | name = 'iverilog', 13 | sources = [ 'iverilog' ], 14 | package = 'iverilog', 15 | ) 16 | -------------------------------------------------------------------------------- /default/rules/nextpnr.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | # main 4 | SourceLocation( 5 | name = 'nextpnr', 6 | vcs = 'git', 7 | location = 'https://github.com/YosysHQ/nextpnr', 8 | revision = 'origin/master', 9 | license_file = 'COPYING', 10 | ) 11 | 12 | Target( 13 | name = 'nextpnr-bba', 14 | sources = [ 'nextpnr' ], 15 | build_native = True, 16 | gitrev = [ ('nextpnr', 'bba') ], 17 | ) 18 | 19 | Target( 20 | name = 'nextpnr-generic', 21 | sources = [ 'nextpnr' ], 22 | dependencies = [ 'python3', 'nextpnr-bba', 'python3-native'], 23 | resources = [ 'python3' ], 24 | ) 25 | 26 | Target( 27 | name = 'nextpnr-ice40', 28 | sources = [ 'nextpnr' ], 29 | dependencies = [ 'python3', 'nextpnr-bba', 'icestorm-bba', 'python3-native'], 30 | resources = [ 'python3' ], 31 | package = 'ice40', 32 | ) 33 | 34 | Target( 35 | name = 'nextpnr-ecp5', 36 | sources = [ 'nextpnr' ], 37 | dependencies = [ 'python3', 'nextpnr-bba', 'prjtrellis-bba', 'python3-native'], 38 | resources = [ 'python3' ], 39 | package = 'ecp5', 40 | ) 41 | 42 | Target( 43 | name = 'nextpnr-machxo2', 44 | sources = [ 'nextpnr' ], 45 | dependencies = [ 'python3', 'nextpnr-bba', 'prjtrellis-bba', 'python3-native'], 46 | resources = [ 'python3' ], 47 | package = 'ecp5', # using same prjtrellis base 48 | ) 49 | 50 | Target( 51 | name = 'nextpnr-nexus', 52 | sources = [ 'nextpnr' ], 53 | dependencies = [ 'python3', 'nextpnr-bba', 'prjoxide-bba', 'python3-native'], 54 | resources = [ 'python3' ], 55 | package = 'nexus', 56 | ) 57 | 58 | Target( 59 | name = 'nextpnr-mistral', 60 | sources = [ 'nextpnr', 'mistral' ], 61 | dependencies = [ 'python3', 'nextpnr-bba', 'python3-native'], 62 | resources = [ 'python3' ], 63 | ) 64 | 65 | Target( 66 | name = 'nextpnr-himbaechel', 67 | sources = [ 'nextpnr' ], 68 | dependencies = [ 'python3', 'nextpnr-bba', 'apicula-bba', 'gatemate-bba', 'python3-native'], 69 | patches = [ 'python3_package.sh' ], 70 | resources = [ 'python3' ], 71 | ) 72 | 73 | # architecture specific 74 | SourceLocation( 75 | name = 'icestorm', 76 | vcs = 'git', 77 | location = 'https://github.com/YosysHQ/icestorm', 78 | revision = 'origin/master', 79 | license_file = 'COPYING', 80 | ) 81 | 82 | SourceLocation( 83 | name = 'prjtrellis', 84 | vcs = 'git', 85 | location = 'https://github.com/YosysHQ/prjtrellis', 86 | revision = 'origin/master', 87 | license_file = 'COPYING', 88 | ) 89 | 90 | SourceLocation( 91 | name = 'prjoxide', 92 | vcs = 'git', 93 | location = 'https://github.com/gatecat/prjoxide', 94 | revision = 'origin/master', 95 | license_file = 'COPYING', 96 | ) 97 | 98 | SourceLocation( 99 | name = 'mistral', 100 | vcs = 'git', 101 | location = 'https://github.com/Ravenslofty/mistral', 102 | revision = 'origin/master', 103 | license_file = 'LICENSE', 104 | ) 105 | 106 | SourceLocation( 107 | name = 'apicula', 108 | vcs = 'git', 109 | location = 'https://github.com/YosysHQ/apicula', 110 | revision = 'origin/master', 111 | license_file = 'LICENSE', 112 | ) 113 | 114 | SourceLocation( 115 | name = 'prjpeppercorn', 116 | vcs = 'git', 117 | location = 'https://github.com/YosysHQ/prjpeppercorn', 118 | revision = 'origin/main', 119 | license_file = 'COPYING', 120 | ) 121 | 122 | Target( 123 | name = 'icestorm', 124 | sources = [ 'icestorm' ], 125 | package = 'ice40', 126 | ) 127 | 128 | Target( 129 | name = 'prjtrellis', 130 | sources = [ 'prjtrellis' ], 131 | package = 'ecp5', 132 | ) 133 | 134 | Target( 135 | name = 'prjoxide', 136 | sources = [ 'prjoxide' ], 137 | package = 'nexus', 138 | ) 139 | 140 | Target( 141 | name = 'apicula', 142 | sources = [ 'apicula' ], 143 | dependencies = [ 'python3', 'python3-native' ], 144 | resources = [ 'python3' ], 145 | package = 'gowin', 146 | ) 147 | 148 | Target( 149 | name = 'prjpeppercorn', 150 | sources = [ 'prjpeppercorn' ], 151 | package = 'gatemate', 152 | ) 153 | 154 | # chip databases 155 | 156 | Target( 157 | name = 'icestorm-bba', 158 | sources = [ 'nextpnr' ], 159 | dependencies = [ 'icestorm' ], 160 | gitrev = [ ('nextpnr', 'ice40') ], 161 | build_native = True, 162 | ) 163 | 164 | Target( 165 | name = 'prjtrellis-bba', 166 | sources = [ 'prjtrellis', 'nextpnr' ], 167 | gitrev = [ ('nextpnr', 'ecp5'), ('nextpnr', 'machxo2') ], 168 | build_native = True, 169 | ) 170 | 171 | Target( 172 | name = 'prjoxide-bba', 173 | sources = [ 'nextpnr' ], 174 | dependencies = [ 'prjoxide' ], 175 | gitrev = [ ('nextpnr', 'nexus') ], 176 | build_native = True, 177 | ) 178 | 179 | Target( 180 | name = 'apicula-bba', 181 | sources = [ 'nextpnr' ], 182 | dependencies = ['python3-native', 'apicula'], 183 | gitrev = [ ('nextpnr', 'himbaechel') ], 184 | package = 'gowin', 185 | build_native = True, 186 | ) 187 | 188 | Target( 189 | name = 'gatemate-bba', 190 | sources = [ 'nextpnr', 'prjpeppercorn' ], 191 | dependencies = ['python3-native'], 192 | gitrev = [ ('nextpnr', 'himbaechel') ], 193 | build_native = True, 194 | ) 195 | -------------------------------------------------------------------------------- /default/rules/programmers.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | # openfpgaloader 4 | 5 | SourceLocation( 6 | name = 'openfpgaloader', 7 | vcs = 'git', 8 | location = 'https://github.com/trabucayre/openFPGALoader', 9 | revision = 'origin/master', 10 | license_file = 'LICENSE', 11 | ) 12 | 13 | Target( 14 | name = 'openfpgaloader', 15 | sources = [ 'openfpgaloader' ], 16 | package = 'programmers', 17 | ) 18 | 19 | # python based programmers 20 | 21 | SourceLocation( 22 | name = 'black-iceprog', 23 | vcs = 'git', 24 | location = 'https://github.com/jpenalbae/black-iceprog', 25 | revision = 'origin/master', 26 | license_file = 'LICENSE.txt', 27 | ) 28 | 29 | SourceLocation( 30 | name = 'icefunprog', 31 | vcs = 'git', 32 | location = 'https://github.com/pitrz/icefunprog', 33 | revision = 'origin/master', 34 | license_file = 'license.txt', 35 | ) 36 | 37 | SourceLocation( 38 | name = 'tinyfpgab', 39 | vcs = 'git', 40 | location = 'https://github.com/tinyfpga/TinyFPGA-B-Series', 41 | revision = 'origin/master', 42 | license_file = 'LICENSE', 43 | ) 44 | 45 | SourceLocation( 46 | name = 'tinyprog', 47 | vcs = 'git', 48 | location = 'https://github.com/tinyfpga/TinyFPGA-Bootloader', 49 | revision = 'origin/master', 50 | license_file = 'LICENSE', 51 | ) 52 | 53 | Target( 54 | name = 'python-programmers', 55 | sources = [ 'black-iceprog', 'icefunprog', 'tinyfpgab', 'tinyprog'], 56 | dependencies = [ 'python3', 'python3-native' ], 57 | patches = [ 'python3_package.sh' ], 58 | resources = [ 'python3' ], 59 | tools = { 60 | 'black-iceprog': ['black-iceprog'], 61 | 'icefunprog': ['icefunprog'], 62 | 'tinyfpgab': ['tinyfpgab'], 63 | 'tinyprog': ['tinyprog'], 64 | 'bin2hex': ['bin2hex', 'hex2bin', 'hex2dump', 'hexdiff', 'hexinfo', 'hexmerge'], 65 | 'pyserial': ['pyserial-miniterm', 'pyserial-ports'], 66 | }, 67 | arch = [ 'linux-x64', 'linux-arm64', 'darwin-x64', 'darwin-arm64' ], 68 | ) 69 | -------------------------------------------------------------------------------- /default/rules/pyhdl.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | # HDL 4 | SourceLocation( 5 | name = 'amaranth', 6 | vcs = 'git', 7 | location = 'https://github.com/amaranth-lang/amaranth', 8 | revision = 'origin/main', 9 | license_file = 'LICENSE.txt', 10 | ) 11 | 12 | SourceLocation( 13 | name = 'amaranth-boards', 14 | vcs = 'git', 15 | location = 'https://github.com/amaranth-lang/amaranth-boards', 16 | revision = 'origin/main', 17 | license_file = 'LICENSE.txt', 18 | ) 19 | 20 | SourceLocation( 21 | name = 'migen', 22 | vcs = 'git', 23 | location = 'https://github.com/m-labs/migen', 24 | revision = 'origin/master', 25 | license_file = 'LICENSE', 26 | ) 27 | 28 | Target( 29 | name = 'pyhdl', 30 | sources = [ 'amaranth', 'amaranth-boards', 'migen' ], 31 | dependencies = [ 'python3', 'python3-native' ], 32 | resources = [ 'python3' ], 33 | patches = [ 'python3_package.sh' ], 34 | ) 35 | -------------------------------------------------------------------------------- /default/rules/python.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | SourceLocation( 4 | name = 'python3', 5 | vcs = 'git', 6 | location = 'https://github.com/python/cpython', 7 | revision = 'tags/v3.11.6', 8 | license_file = 'LICENSE', 9 | ) 10 | 11 | Target( 12 | name = 'python3', 13 | sources = [ 'python3' ], 14 | dependencies = [ 'python3-native' ], 15 | patches = [ 'python3.11.6-mingw.diff', 'python3.11.6-darwin.diff' ], 16 | ) 17 | 18 | Target( 19 | name = 'python3-native', 20 | sources = [ 'python3' ], 21 | build_native = True, 22 | ) 23 | 24 | SourceLocation( 25 | name = 'python2', 26 | vcs = 'git', 27 | location = 'https://github.com/python/cpython', 28 | revision = 'tags/v2.7.18', 29 | license_file = 'LICENSE', 30 | ) 31 | 32 | Target( 33 | name = 'python2', 34 | sources = [ 'python2' ], 35 | dependencies = [ 'python2-native' ], 36 | patches = [ 'python27.diff'], 37 | ) 38 | 39 | Target( 40 | name = 'python2-native', 41 | sources = [ 'python2' ], 42 | patches = [ 'python27.diff'], 43 | build_native = True, 44 | ) 45 | -------------------------------------------------------------------------------- /default/rules/resources-min.py: -------------------------------------------------------------------------------- 1 | from src.base import Target 2 | 3 | Target( 4 | name = 'system-resources-min', 5 | sources = [ ], 6 | patches = [ 'fonts.conf.template', 'win-launcher.c', 'environment', 'environment.bat', 'environment.ps1', 'start.bat', 'cacert.pem', 'tabbyadm' ], 7 | tools = {}, 8 | ) 9 | -------------------------------------------------------------------------------- /default/rules/resources.py: -------------------------------------------------------------------------------- 1 | from src.base import Target 2 | 3 | Target( 4 | name = 'system-resources', 5 | sources = [ ], 6 | patches = [ 'fonts.conf.template', 'win-launcher.c', 'environment', 'environment.fish', 'environment.bat', 'environment.ps1', 'start.bat', 'cacert.pem', 'tabbyadm' ], 7 | tools = {}, 8 | ) 9 | 10 | Target( 11 | name = 'system-resources-tabby', 12 | sources = [ ], 13 | patches = [ 'fonts.conf.template', 'win-launcher.c', 'environment', 'environment.bat', 'environment.ps1', 'start.bat', 'cacert.pem', 'tabbyadm' ], 14 | tools = {}, 15 | ) 16 | -------------------------------------------------------------------------------- /default/rules/solvers.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | # avy 4 | SourceLocation( 5 | name = 'avy', 6 | vcs = 'git', 7 | location = 'https://bitbucket.org/arieg/extavy', 8 | revision = 'origin/master', 9 | license_url = 'https://bitbucket.org/arieg/avy/raw/a9685b8ba660e46fc3325797ef059cbe95adaf10/LICENSE', 10 | ) 11 | 12 | Target( 13 | name = 'avy', 14 | sources = [ 'avy' ], 15 | patches = [ 'avy.diff' ], 16 | ) 17 | 18 | # bitwuzla 19 | 20 | SourceLocation( 21 | name = 'symfpu', 22 | vcs = 'git', 23 | location = 'https://github.com/martin-cs/symfpu', 24 | revision = '8fbe139bf0071cbe0758d2f6690a546c69ff0053', 25 | license_file = 'LICENSE', 26 | license_build_only = True, 27 | ) 28 | 29 | Target( 30 | name = 'symfpu', 31 | sources = [ 'symfpu' ], 32 | patches = [ 'symfpu_20201114.patch' ], 33 | license_build_only = True, 34 | build_native = True, # header only library 35 | ) 36 | 37 | SourceLocation( 38 | name = 'bitwuzla', 39 | vcs = 'git', 40 | location = 'https://github.com/bitwuzla/bitwuzla', 41 | revision = '6e46391816b4baf8c9fc0b8c0c1d2fbe63b6f30e', 42 | license_file = 'COPYING', 43 | ) 44 | 45 | Target( 46 | name = 'bitwuzla', 47 | sources = [ 'bitwuzla' ], 48 | dependencies = [ 'lingeling', 'cadical', 'btor2tools', 'symfpu' ], 49 | patches = [ 'Toolchain-mingw64.cmake' ], 50 | ) 51 | 52 | # boolector 53 | 54 | SourceLocation( 55 | name = 'lingeling', 56 | vcs = 'git', 57 | location = 'https://github.com/arminbiere/lingeling', 58 | revision = 'origin/master', 59 | license_file = 'COPYING', 60 | license_build_only = True, 61 | ) 62 | 63 | Target( 64 | name = 'lingeling', 65 | sources = [ 'lingeling' ], 66 | patches = [ 'Lingeling_20190110.patch' ], 67 | license_build_only = True, 68 | ) 69 | 70 | SourceLocation( 71 | name = 'cadical', 72 | vcs = 'git', 73 | location = 'https://github.com/arminbiere/cadical', 74 | revision = 'e7369b4b04fafe8b4b139d5e181528f5006d0816', 75 | license_file = 'LICENSE', 76 | license_build_only = True, 77 | ) 78 | 79 | Target( 80 | name = 'cadical', 81 | sources = [ 'cadical' ], 82 | patches = [ 'CaDiCaL_20190730.patch' ], 83 | license_build_only = True, 84 | ) 85 | 86 | SourceLocation( 87 | name = 'btor2tools', 88 | vcs = 'git', 89 | location = 'https://github.com/Boolector/btor2tools', 90 | revision = 'origin/master', 91 | license_file = 'LICENSE.txt', 92 | license_build_only = True, 93 | ) 94 | 95 | Target( 96 | name = 'btor2tools', 97 | sources = [ 'btor2tools' ], 98 | license_build_only = True, 99 | ) 100 | 101 | SourceLocation( 102 | name = 'boolector', 103 | vcs = 'git', 104 | location = 'https://github.com/Boolector/boolector', 105 | revision = 'origin/master', 106 | license_file = 'COPYING', 107 | ) 108 | 109 | Target( 110 | name = 'boolector', 111 | sources = [ 'boolector' ], 112 | dependencies = [ 'lingeling', 'cadical', 'btor2tools' ], 113 | patches = [ 'Toolchain-mingw64.cmake' ], 114 | ) 115 | 116 | # pono 117 | 118 | SourceLocation( 119 | name = 'smt-switch', 120 | vcs = 'git', 121 | location = 'https://github.com/makaimann/smt-switch', 122 | revision = 'f2d7d3d6dfccc0b4d6b604563acd34629bac884d', 123 | license_file = 'LICENSE', 124 | license_build_only = True, 125 | ) 126 | 127 | SourceLocation( 128 | name = 'pono', 129 | vcs = 'git', 130 | location = 'https://github.com/upscale-project/pono', 131 | revision = 'b243cef7ea0c98840e7e012f5ce30f3430b1edcc', 132 | license_file = 'LICENSE', 133 | ) 134 | 135 | SourceLocation( 136 | name = 'cvc4', 137 | vcs = 'git', 138 | location = 'https://github.com/CVC4/CVC4.git', 139 | revision = '3dda54ba7e6952060766775c56969ab920430a8a', 140 | license_file = 'COPYING', 141 | license_build_only = True, 142 | ) 143 | 144 | SourceLocation( 145 | name = 'cvc5', 146 | vcs = 'git', 147 | location = 'https://github.com/cvc5/cvc5', 148 | revision = '77d0bec48a745e3c4acd65085f9c59bdfceed6c0', 149 | license_file = 'COPYING', 150 | license_build_only = True, 151 | ) 152 | 153 | SourceLocation( 154 | name = 'libpoly', 155 | vcs = 'git', 156 | location = 'https://github.com/SRI-CSL/libpoly', 157 | revision = '1383809f2aa5005ef20110fec84b66959518f697', 158 | license_file = 'LICENCE', 159 | license_build_only = True, 160 | ) 161 | 162 | Target( 163 | name = 'libpoly', 164 | sources = [ 'libpoly' ], 165 | license_build_only = True, 166 | ) 167 | 168 | Target( 169 | name = 'cvc5', 170 | sources = [ 'cvc5' ], 171 | dependencies = [ 'libpoly', 'cadical', 'symfpu' ], 172 | patches = [ 'get-antlr-3.4' ], 173 | license_build_only = True, 174 | ) 175 | 176 | Target( 177 | name = 'cvc4', 178 | sources = [ 'cvc4' ], 179 | license_build_only = True, 180 | ) 181 | 182 | Target( 183 | name = 'smt-switch', 184 | sources = [ 'smt-switch' ], 185 | dependencies = [ 'cvc5', 'boolector'], 186 | patches = [ 'smt-switch-win32.diff', 'Toolchain-mingw64.cmake' ], 187 | license_build_only = True, 188 | ) 189 | 190 | Target( 191 | name = 'pono', 192 | sources = [ 'pono' ], 193 | dependencies = [ 'smt-switch', 'cvc5', 'boolector' ], 194 | ) 195 | 196 | # suprove 197 | 198 | SourceLocation( 199 | name = 'suprove', 200 | vcs = 'git', 201 | location = 'https://github.com/sterin/super-prove-build', 202 | revision = 'origin/master', 203 | license_file = 'pywrapper/LICENSE', 204 | ) 205 | 206 | Target( 207 | name = 'suprove', 208 | sources = [ 'suprove' ], 209 | dependencies = [ 'python2' ], 210 | resources = [ 'python2' ], 211 | patches = [ 'suprove.diff' ], 212 | arch = [ 'linux-x64', 'linux-arm64' ], 213 | ) 214 | 215 | # yices 216 | 217 | SourceLocation( 218 | name = 'yices', 219 | vcs = 'git', 220 | location = 'https://github.com/SRI-CSL/yices2', 221 | revision = 'origin/master', 222 | license_file = 'LICENSE.txt', 223 | ) 224 | 225 | Target( 226 | name = 'yices', 227 | sources = [ 'yices' ], 228 | ) 229 | 230 | # z3 231 | 232 | SourceLocation( 233 | name = 'z3', 234 | vcs = 'git', 235 | location = 'https://github.com/Z3Prover/z3', 236 | revision = 'origin/master', 237 | license_file = 'LICENSE.txt', 238 | ) 239 | 240 | Target( 241 | name = 'z3', 242 | sources = [ 'z3' ], 243 | ) 244 | 245 | # aiger 246 | 247 | SourceLocation( 248 | name = 'aiger', 249 | vcs = 'git', 250 | location = 'https://github.com/arminbiere/aiger', 251 | revision = 'origin/master', 252 | license_file = 'LICENSE', 253 | ) 254 | 255 | SourceLocation( 256 | name = 'picosat', 257 | vcs = 'git', 258 | location = 'https://github.com/mmicko/picosat', 259 | revision = 'origin/main', 260 | license_file = 'LICENSE', 261 | license_build_only = True, 262 | ) 263 | 264 | Target( 265 | name = 'picosat', 266 | sources = [ 'picosat' ], 267 | license_build_only = True, 268 | ) 269 | 270 | Target( 271 | name = 'aiger', 272 | sources = [ 'lingeling', 'aiger' ], 273 | dependencies = [ 'picosat' ], 274 | arch = [ 'linux-x64', 'linux-arm64', 'darwin-x64', 'darwin-arm64' ], 275 | ) 276 | -------------------------------------------------------------------------------- /default/rules/utils.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | # libusb 4 | SourceLocation( 5 | name = 'libusb', 6 | vcs = 'git', 7 | location = 'https://github.com/libusb/libusb', 8 | revision = 'tags/v1.0.24', 9 | license_file = 'COPYING', 10 | ) 11 | 12 | # libftdi 13 | SourceLocation( 14 | name = 'libftdi', 15 | vcs = 'git', 16 | location = 'git://developer.intra2net.com/libftdi', 17 | revision = 'tags/v1.5', 18 | license_file = 'LICENSE', 19 | ) 20 | 21 | # dfu-util 22 | 23 | SourceLocation( 24 | name = 'dfu-util', 25 | vcs = 'git', 26 | location = 'https://git.code.sf.net/p/dfu-util/dfu-util', 27 | revision = 'origin/master', 28 | license_file = 'COPYING', 29 | ) 30 | 31 | # ecpdap 32 | 33 | SourceLocation( 34 | name = 'ecpdap', 35 | vcs = 'git', 36 | location = 'https://github.com/adamgreig/ecpdap', 37 | revision = 'origin/master', 38 | license_file = 'LICENSE-MIT', 39 | ) 40 | 41 | # ecpprog 42 | 43 | SourceLocation( 44 | name = 'ecpprog', 45 | vcs = 'git', 46 | location = 'https://github.com/gregdavill/ecpprog', 47 | revision = 'origin/main', 48 | license_file = 'COPYING', 49 | ) 50 | 51 | # fujprog 52 | 53 | SourceLocation( 54 | name = 'fujprog', 55 | vcs = 'git', 56 | location = 'https://github.com/kost/fujprog', 57 | revision = 'origin/master', 58 | license_file = 'LICENSE', 59 | ) 60 | 61 | # openocd 62 | 63 | SourceLocation( 64 | name = 'openocd', 65 | vcs = 'git', 66 | location = 'https://repo.or.cz/openocd.git', 67 | revision = 'b6ee13720688a9860f3397bb89ea171b0fc5ccce', 68 | license_file = 'COPYING', 69 | ) 70 | 71 | # iceprogduino 72 | 73 | SourceLocation( 74 | name = 'iceprogduino', 75 | vcs = 'git', 76 | location = 'https://github.com/OLIMEX/iCE40HX1K-EVB', 77 | revision = 'origin/master', 78 | license_file = 'LICENSE', 79 | ) 80 | 81 | # icesprog 82 | 83 | SourceLocation( 84 | name = 'icesprog', 85 | vcs = 'git', 86 | location = 'https://github.com/wuxx/icesugar', 87 | revision = 'origin/master', 88 | no_submodules = True, 89 | ) 90 | 91 | Target( 92 | name = 'utils', 93 | sources = [ 'libusb', 'libftdi', 'dfu-util', 'ecpdap', 'ecpprog', 'fujprog', 'openocd', 'iceprogduino', 'icesprog' ], 94 | package = 'programmers', 95 | ) 96 | -------------------------------------------------------------------------------- /default/rules/verilator.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | SourceLocation( 4 | name = 'verilator', 5 | vcs = 'git', 6 | location = 'https://github.com/verilator/verilator', 7 | revision = 'origin/master', 8 | license_file = 'LICENSE', 9 | ) 10 | 11 | Target( 12 | name = 'verilator', 13 | sources = [ 'verilator' ], 14 | package = 'verilator', 15 | ) 16 | -------------------------------------------------------------------------------- /default/rules/yosys.py: -------------------------------------------------------------------------------- 1 | from src.base import SourceLocation, Target 2 | 3 | SourceLocation( 4 | name = 'yosys', 5 | vcs = 'git', 6 | location = 'https://github.com/YosysHQ/yosys', 7 | revision = 'origin/main', 8 | license_file = 'COPYING', 9 | ) 10 | 11 | SourceLocation( 12 | name = 'ghdl-yosys-plugin', 13 | vcs = 'git', 14 | location = 'https://github.com/ghdl/ghdl-yosys-plugin', 15 | revision = 'origin/master', 16 | license_file = 'LICENSE', 17 | ) 18 | 19 | SourceLocation( 20 | name = 'slang', 21 | vcs = 'git', 22 | location = 'https://github.com/MikePopoloski/slang', 23 | revision = 'origin/master', 24 | license_file = 'LICENSE', 25 | license_build_only = True, 26 | ) 27 | 28 | SourceLocation( 29 | name = 'yosys-slang-plugin', 30 | vcs = 'git', 31 | location = 'https://github.com/povik/yosys-slang', 32 | revision = 'origin/master', 33 | license_file = 'LICENSE', 34 | ) 35 | 36 | SourceLocation( 37 | name = 'graphviz', 38 | vcs = 'git', 39 | location = 'https://gitlab.com/graphviz/graphviz', 40 | revision = 'tags/2.42.2', 41 | license_file = 'LICENSE', 42 | ) 43 | 44 | SourceLocation( 45 | name = 'abc', 46 | vcs = 'git', 47 | location = 'https://github.com/YosysHQ/abc', 48 | revision = 'origin/yosys-experimental', 49 | license_file = 'copyright.txt', 50 | license_build_only = True, 51 | ) 52 | 53 | Target( 54 | name = 'abc', 55 | sources = [ 'abc'], 56 | build_native = True, # using this for license only 57 | license_build_only = True, 58 | ) 59 | 60 | Target( 61 | name = 'yosys', 62 | sources = [ 'yosys'], 63 | resources = [ 'xdot', 'graphviz' ], 64 | dependencies = [ 'abc' ], 65 | critical = True, 66 | ) 67 | 68 | Target( 69 | name = 'ghdl-yosys-plugin', 70 | sources = [ 'ghdl-yosys-plugin' ], 71 | dependencies = [ 'ghdl', 'yosys' ], 72 | arch = [ 'linux-x64', 'darwin-x64', 'darwin-arm64' ], 73 | ) 74 | 75 | Target( 76 | name = 'slang', 77 | sources = [ 'slang'], 78 | build_native = True, # using this for license only 79 | license_build_only = True, 80 | ) 81 | 82 | Target( 83 | name = 'yosys-slang-plugin', 84 | sources = [ 'yosys-slang-plugin' ], 85 | dependencies = [ 'yosys' ], 86 | critical = True, 87 | ) 88 | 89 | SourceLocation( 90 | name = 'xdot', 91 | vcs = 'git', 92 | location = 'https://github.com/jrfonseca/xdot.py', 93 | revision = '6248c81c21a0fe825089311b17f2c302eea614a2', 94 | license_file = 'LICENSE.txt', 95 | ) 96 | 97 | Target( 98 | name = 'xdot', 99 | dependencies = [ 'python3', 'python3-native' ], 100 | resources = [ 'python3' ], 101 | patches = [ 'python3_package.sh' ], 102 | sources = [ 'xdot' ], 103 | arch = [ 'linux-x64', 'linux-arm64', 'darwin-x64', 'darwin-arm64' ], 104 | ) 105 | 106 | Target( 107 | name = 'graphviz', 108 | patches = [ 'graphviz_fix.diff' ], 109 | sources = [ 'graphviz' ], 110 | arch = [ 'linux-x64', 'linux-arm64', 'darwin-x64', 'darwin-arm64' ], 111 | ) 112 | -------------------------------------------------------------------------------- /default/scripts/abc.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YosysHQ/oss-cad-suite-build/72b0fddba33eba30fa9935f67bed40cfbc736fe5/default/scripts/abc.sh -------------------------------------------------------------------------------- /default/scripts/aiger.sh: -------------------------------------------------------------------------------- 1 | mv ${BUILD_DIR}/picosat/dev/* ${BUILD_DIR}/picosat 2 | cd aiger 3 | $CC -O3 -DNDEBUG -c aiger.c 4 | cd ../lingeling 5 | ./configure.sh 6 | make 7 | cd ../aiger 8 | sed -i 's,/@CC@/$CC/,|@CC@|$CC|,g' configure.sh 9 | sed -i 's,/usr/local,${OUTPUT_DIR}${INSTALL_PREFIX},g' makefile.in 10 | sed -i 's,755 -s,755,g' makefile.in 11 | ./configure.sh 12 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/bin 13 | make install 14 | ${STRIP} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/* 15 | -------------------------------------------------------------------------------- /default/scripts/apicula-bba.sh: -------------------------------------------------------------------------------- 1 | cd nextpnr 2 | cp -R ${BUILD_DIR}/apicula${INSTALL_PREFIX}/lib/python3.11/site-packages/* ${BUILD_DIR}/python3-native${INSTALL_PREFIX}/lib/python3.11/site-packages/. 3 | cp ${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin/python3.11 ${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin/python 4 | cmake -DPython3_EXECUTABLE=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin/python3.11 \ 5 | -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 6 | -DARCH=himbaechel -DHIMBAECHEL_UARCH=gowin \ 7 | -DHIMBAECHEL_GOWIN_DEVICES=all \ 8 | -DEXPORT_BBA_FILES=${OUTPUT_DIR}/bba-files \ 9 | -B build 10 | 11 | make -C build nextpnr-all-bba 12 | -------------------------------------------------------------------------------- /default/scripts/apicula.sh: -------------------------------------------------------------------------------- 1 | cd apicula 2 | source ${PATCHES_DIR}/python3_package.sh 3 | python3_package_setup 4 | python3_package_pip_install "crc" 5 | curl -L https://github.com/YosysHQ/apicula/releases/download/0.0.0.dev/linux-x64-gowin-data.tgz > linux-x64-gowin-data.tgz 6 | tar xvfz linux-x64-gowin-data.tgz 7 | python3_package_install --old-and-unmanageable 8 | -------------------------------------------------------------------------------- /default/scripts/avy.sh: -------------------------------------------------------------------------------- 1 | cd avy 2 | patch -p1 < ${PATCHES_DIR}/avy.diff 3 | mkdir -p build 4 | cd build 5 | if [ ${ARCH_BASE} == 'windows' ]; then 6 | cmake .. -DCMAKE_BUILD_TYPE=Release -D CMAKE_CXX_FLAGS="-DABC_USE_STDINT_H -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w" -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} 7 | elif [ ${ARCH_BASE} == 'darwin' ]; then 8 | cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -D CMAKE_CXX_FLAGS="-Wno-register -Wno-deprecated" 9 | else 10 | cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} 11 | fi 12 | 13 | make -j${NPROC} 14 | mkdir -p ${OUTPUT_DIR}/${INSTALL_PREFIX}/bin 15 | ${STRIP} avy/src/{avy${EXE},avybmc${EXE}} 16 | cp avy/src/{avy${EXE},avybmc${EXE}} "${OUTPUT_DIR}${INSTALL_PREFIX}/bin/" -------------------------------------------------------------------------------- /default/scripts/bitwuzla.sh: -------------------------------------------------------------------------------- 1 | mkdir -p bitwuzla/deps/install 2 | cp -r btor2tools/${INSTALL_PREFIX}/* bitwuzla/deps/install/. 3 | cp -r cadical/${INSTALL_PREFIX}/* bitwuzla/deps/install/. 4 | cp -r lingeling/${INSTALL_PREFIX}/* bitwuzla/deps/install/. 5 | cp -r symfpu/${INSTALL_PREFIX}/* bitwuzla/deps/install/. 6 | 7 | cd bitwuzla 8 | 9 | # Build Bitwuzla 10 | sed -i -re "s,cmake ..,cmake .. -DCMAKE_TOOLCHAIN_FILE=\${CMAKE_TOOLCHAIN_FILE},g" ./configure.sh 11 | if [ ${ARCH_BASE} == 'windows' ]; then 12 | export CMAKE_TOOLCHAIN_FILE=${PATCHES_DIR}/Toolchain-mingw64.cmake 13 | fi 14 | ./configure.sh --prefix ${INSTALL_PREFIX} -fPIC 15 | cd build 16 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 17 | # Do not expose includes and libs in final package 18 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/include 19 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib 20 | -------------------------------------------------------------------------------- /default/scripts/boolector.sh: -------------------------------------------------------------------------------- 1 | mkdir -p boolector/deps/install 2 | cp -r btor2tools/${INSTALL_PREFIX}/* boolector/deps/install/. 3 | cp -r cadical/${INSTALL_PREFIX}/* boolector/deps/install/. 4 | cp -r lingeling/${INSTALL_PREFIX}/* boolector/deps/install/. 5 | cd boolector 6 | 7 | if [ ${ARCH_BASE} == 'windows' ]; then 8 | export CMAKE_TOOLCHAIN_FILE=${PATCHES_DIR}/Toolchain-mingw64.cmake 9 | mkdir -p build 10 | cd build 11 | cmake .. -DPYTHON=OFF -DIS_WINDOWS_BUILD=1 -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} 12 | cd .. 13 | else 14 | sed -i -re "s,cmake ..,cmake .. -DCMAKE_TOOLCHAIN_FILE=\${CMAKE_TOOLCHAIN_FILE},g" ./configure.sh 15 | ./configure.sh --prefix ${INSTALL_PREFIX} -fPIC 16 | fi 17 | cd build 18 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} 19 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 20 | cp ../../btor2tools/${INSTALL_PREFIX}/bin/btorsim${EXE} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/ 21 | ${STRIP} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/btorsim${EXE} 22 | cd .. 23 | # Need to expose like this since smt-switch and pono use build tree instead of installed libs 24 | mkdir -p ${OUTPUT_DIR}/dev 25 | mkdir -p ${OUTPUT_DIR}/dev/build/lib 26 | mkdir -p ${OUTPUT_DIR}/dev/deps/lingeling/build 27 | mkdir -p ${OUTPUT_DIR}/dev/deps/cadical/build 28 | mkdir -p ${OUTPUT_DIR}/dev/deps/btor2tools/build 29 | mkdir -p ${OUTPUT_DIR}/dev/deps/btor2tools/src/btor2parser 30 | cp -r src ${OUTPUT_DIR}/dev/. 31 | cp -r build/lib/libboolector.a ${OUTPUT_DIR}/dev/build/lib/libboolector.a 32 | cp -r deps/install/lib/liblgl.a ${OUTPUT_DIR}/dev/deps/lingeling/build/liblgl.a 33 | cp -r deps/install/lib/libcadical.a ${OUTPUT_DIR}/dev/deps/cadical/build/libcadical.a 34 | cp -r deps/install/lib/libbtor2parser.a ${OUTPUT_DIR}/dev/deps/btor2tools/build/libbtor2parser.a 35 | cp -r deps/install/include/btor2parser.h ${OUTPUT_DIR}/dev/deps/btor2tools/src/btor2parser/btor2parser.h 36 | # Do not expose includes and libs in final package 37 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/include 38 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib 39 | -------------------------------------------------------------------------------- /default/scripts/btor2tools.sh: -------------------------------------------------------------------------------- 1 | cd btor2tools 2 | 3 | if [ ${ARCH_BASE} == 'windows' ]; then 4 | export CXXFLAGS="-D__STDC_FORMAT_MACROS=1" 5 | fi 6 | 7 | mkdir build 8 | cd build 9 | 10 | cmake .. \ 11 | -DBUILD_SHARED_LIBS=OFF \ 12 | -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ 13 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 14 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_TOOLS=ON 15 | 16 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 17 | -------------------------------------------------------------------------------- /default/scripts/cadical.sh: -------------------------------------------------------------------------------- 1 | cd cadical 2 | if [ ${ARCH_BASE} == 'windows' ]; then 3 | git checkout cb89cbfa16f47cb7bf1ec6ad9855e7b6d5203c18 4 | patch -p1 < ${PATCHES_DIR}/CaDiCaL_20190730.patch 5 | fi 6 | if [ ${ARCH} == 'linux-arm64' ]; then 7 | sed -i '318,436d' configure 8 | fi 9 | if [ ${ARCH_BASE} == 'darwin' ]; then 10 | sed -i '318,436d' configure 11 | fi 12 | if [ ${ARCH_BASE} == 'windows' ]; then 13 | sed -i '247,347d' configure 14 | export CXXFLAGS="" 15 | EXTRA_FLAGS="-q" 16 | else 17 | export CXXFLAGS="-fPIC" 18 | fi 19 | ./configure ${EXTRA_FLAGS} 20 | make -j${NPROC} 21 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/include 22 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/lib 23 | cp src/ccadical.h ${OUTPUT_DIR}${INSTALL_PREFIX}/include/. 24 | cp src/cadical.hpp ${OUTPUT_DIR}${INSTALL_PREFIX}/include/. 25 | cp build/libcadical.a ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/. 26 | -------------------------------------------------------------------------------- /default/scripts/cocotb.sh: -------------------------------------------------------------------------------- 1 | source ${PATCHES_DIR}/python3_package.sh 2 | python3_package_setup 3 | if [ ${ARCH} == 'darwin-x64' ]; then 4 | sed -i -re "s,sys.platform == \"darwin\",sysconfig.get_platform() == \"darwin-x64\",g" cocotb/cocotb_build_libs.py 5 | elif [ ${ARCH} == 'darwin-arm64' ]; then 6 | sed -i -re "s,sys.platform == \"darwin\",sysconfig.get_platform() == \"darwin-aarch64\",g" cocotb/cocotb_build_libs.py 7 | fi 8 | pushd cocotb 9 | python3_package_install 10 | python3_package_pth "cocotb" 11 | python3_package_pip_install "pytest" 12 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python3.11/site-packages/cocotb/share/makefiles/simulators/Makefile.verilator 13 | -------------------------------------------------------------------------------- /default/scripts/cvc4.sh: -------------------------------------------------------------------------------- 1 | cd cvc4 2 | export MACHINE_TYPE=x86_64 3 | if [ ${ARCH_BASE} != 'windows' ]; then 4 | sed -i -re 's,rm -rf src/antlr3debughandlers.c \&\& touch src/antlr3debughandlers.c,rm -rf src/antlr3debughandlers.c \&\& touch src/antlr3debughandlers.c \&\& cp /usr/share/misc/config.* . ,g' ./contrib/get-antlr-3.4 5 | else 6 | sed -i 's,#!/usr/bin/env bash,#!/usr/bin/env bash\nshopt -u patsub_replacement,g' src/expr/mkmetakind 7 | sed -i 's,#include ,#include \n#include ,g' src/expr/metakind_template.h 8 | sed -i 's,#include ,#include \n#include ,g' src/api/cvc4cpp.h 9 | fi 10 | ANTLR_CONFIGURE_ARGS="--host=${CROSS_NAME} --build=`gcc -dumpmachine`" ./contrib/get-antlr-3.4 11 | git clone https://github.com/uiri/toml.git 12 | export PYTHONPATH=$PYTHONPATH:`pwd`/toml 13 | if [ ${ARCH_BASE} == 'windows' ]; then 14 | export CMAKE_TOOLCHAIN_FILE=${PATCHES_DIR}/Toolchain-mingw64.cmake 15 | sed -i -re 's,cmake \"\$root_dir\" \$cmake_opts,cmake \"\$root_dir\" \$cmake_opts -DCMAKE_TOOLCHAIN_FILE=\$\{CMAKE_TOOLCHAIN_FILE\} -DCVC4_WINDOWS_BUILD=TRUE,g' configure.sh 16 | else 17 | sed -i -re 's,cmake \"\$root_dir\" \$cmake_opts,cmake \"\$root_dir\" \$cmake_opts -DCMAKE_TOOLCHAIN_FILE=\$\{CMAKE_TOOLCHAIN_FILE\},g' configure.sh 18 | fi 19 | CXXFLAGS=-fPIC CFLAGS=-fPIC ./configure.sh --static --no-static-binary --prefix=${INSTALL_PREFIX} --no-unit-testing 20 | cd build 21 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} 22 | make DESTDIR=${OUTPUT_DIR} install 23 | cd .. 24 | mkdir -p ${OUTPUT_DIR}/dev 25 | mkdir -p ${OUTPUT_DIR}/dev/build 26 | cp -r src ${OUTPUT_DIR}/dev/. 27 | cp -r build/src ${OUTPUT_DIR}/dev/build/. 28 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/include 29 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib 30 | -------------------------------------------------------------------------------- /default/scripts/cvc5.sh: -------------------------------------------------------------------------------- 1 | cd cvc5 2 | cp ${PATCHES_DIR}/get-antlr-3.4 contrib/. 3 | mkdir -p deps/install 4 | cp -r ${BUILD_DIR}/libpoly/yosyshq/* deps/install/. 5 | cp -r ${BUILD_DIR}/cadical/yosyshq/* deps/install/. 6 | cp -r ${BUILD_DIR}/symfpu/yosyshq/* deps/install/. 7 | export MACHINE_TYPE=x86_64 8 | if [ ${ARCH_BASE} != 'windows' ]; then 9 | sed -i -re 's,rm -rf src/antlr3debughandlers.c \&\& touch src/antlr3debughandlers.c,rm -rf src/antlr3debughandlers.c \&\& touch src/antlr3debughandlers.c \&\& cp /usr/share/misc/config.* . ,g' ./contrib/get-antlr-3.4 10 | else 11 | sed -i 's,#!/usr/bin/env bash,#!/usr/bin/env bash\nshopt -u patsub_replacement,g' src/expr/mkmetakind 12 | sed -i 's,#include ,#include \n#include ,g' src/expr/metakind_template.h 13 | sed -i 's,#include ,#include \n#include ,g' src/api/cpp/cvc5.h 14 | sed -i 's,#include ,#include \n#include ,g' src/util/didyoumean.cpp 15 | fi 16 | ANTLR_CONFIGURE_ARGS="--host=${CROSS_NAME} --build=`gcc -dumpmachine`" ./contrib/get-antlr-3.4 17 | git clone https://github.com/uiri/toml.git 18 | cd toml 19 | git checkout 5706d3155f4da8f3b84875f80bfe0dfc6565f61f 20 | cd .. 21 | export PYTHONPATH=$PYTHONPATH:`pwd`/toml 22 | if [ ${ARCH_BASE} == 'windows' ]; then 23 | export CMAKE_TOOLCHAIN_FILE=${PATCHES_DIR}/Toolchain-mingw64.cmake 24 | fi 25 | sed -i -re 's,cmake \"\$root_dir\" \$cmake_opts,cmake \"\$root_dir\" \$cmake_opts -DCMAKE_TOOLCHAIN_FILE=\$\{CMAKE_TOOLCHAIN_FILE\},g' configure.sh 26 | CXXFLAGS=-fPIC CFLAGS=-fPIC ./configure.sh --static --no-static-binary --prefix=${INSTALL_PREFIX} --no-unit-testing 27 | cd build 28 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} 29 | make DESTDIR=${OUTPUT_DIR} install 30 | cd .. 31 | mkdir -p ${OUTPUT_DIR}/dev 32 | mkdir -p ${OUTPUT_DIR}/dev/build/deps/lib 33 | cp -r src ${OUTPUT_DIR}/dev/. 34 | cp -r build/src ${OUTPUT_DIR}/dev/build/. 35 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/include 36 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib 37 | cp -r ${BUILD_DIR}/libpoly/yosyshq/lib/*.a ${OUTPUT_DIR}/dev/build/deps/lib/. 38 | cp -r ${BUILD_DIR}/cadical/yosyshq/lib/*.a ${OUTPUT_DIR}/dev/build/deps/lib/. 39 | -------------------------------------------------------------------------------- /default/scripts/eqy.sh: -------------------------------------------------------------------------------- 1 | sed -i 's,/yosyshq/share,../yosys/yosyshq/share,g' yosys/yosyshq/bin/yosys-config 2 | sed -i 's,/yosyshq/include,../yosys/yosyshq/include,g' yosys/yosyshq/bin/yosys-config 3 | sed -i 's,/yosyshq/lib,../yosys/yosyshq/lib,g' yosys/yosyshq/bin/yosys-config 4 | 5 | cd eqy 6 | export PATH=../yosys/yosyshq/bin:$PATH 7 | make PREFIX=${OUTPUT_DIR}${INSTALL_PREFIX} -j${NPROC} install 8 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/examples/eqy 9 | cp -r examples/* ${OUTPUT_DIR}${INSTALL_PREFIX}/examples/eqy/. 10 | -------------------------------------------------------------------------------- /default/scripts/formal.sh: -------------------------------------------------------------------------------- 1 | source ${PATCHES_DIR}/python3_package.sh 2 | python3_package_setup 3 | # scy 4 | cd ${BUILD_DIR}/scy 5 | sed -i 's,"yosys_mau,#"yosys_mau,g' pyproject.toml 6 | python3_package_pip_install "." 7 | mv ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python3.11/site-packages/bin ${OUTPUT_DIR}${INSTALL_PREFIX}/. 8 | #mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/examples/scy 9 | #cp -r example/* ${OUTPUT_DIR}${INSTALL_PREFIX}/examples/scy/. 10 | 11 | # flask 12 | python3_package_pip_install "Werkzeug==2.3.7" 13 | python3_package_pip_install "flask==2.1.2" 14 | if [ ${ARCH_BASE} == 'windows' ]; then 15 | python3_package_pip_install "colorama" 16 | fi 17 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python3.11/site-packages/bin 18 | 19 | # mau 20 | cd ${BUILD_DIR}/mau 21 | python3_package_install 22 | 23 | # mcy 24 | cd ${BUILD_DIR}/mcy 25 | sed -i -re "s,cmake,cmake -DCMAKE_TOOLCHAIN_FILE=\${CMAKE_TOOLCHAIN_FILE},g" Makefile 26 | make PREFIX=${INSTALL_PREFIX} DESTDIR=${OUTPUT_DIR} -j${NPROC} install 27 | ${STRIP} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/mcy-gui${EXE} 28 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/examples/mcy_demo 29 | cp -r examples/* ${OUTPUT_DIR}${INSTALL_PREFIX}/examples/mcy_demo/. 30 | 31 | # sby 32 | cd ${BUILD_DIR}/sby 33 | make PREFIX=${INSTALL_PREFIX} DESTDIR=${OUTPUT_DIR} -j${NPROC} install 34 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/examples 35 | cp -r docs/examples/* ${OUTPUT_DIR}${INSTALL_PREFIX}/examples/. 36 | find ${OUTPUT_DIR}${INSTALL_PREFIX}/examples/ -name "Makefile" -type f -delete 37 | find ${OUTPUT_DIR}${INSTALL_PREFIX}/examples/ -name ".gitignore" -type f -delete 38 | cargo install --no-track --path tools/aigcexmin --root ${OUTPUT_DIR}${INSTALL_PREFIX} --target=${CARGO_TARGET} 39 | 40 | # sby-gui 41 | cd ${BUILD_DIR}/sby-gui 42 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} . 43 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 44 | ${STRIP} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/sby-gui${EXE} 45 | -------------------------------------------------------------------------------- /default/scripts/gatemate-bba.sh: -------------------------------------------------------------------------------- 1 | pushd prjpeppercorn 2 | sh delay.sh 3 | popd 4 | cd nextpnr 5 | cp ${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin/python3.11 ${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin/python 6 | cmake -DPython3_EXECUTABLE=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin/python3.11 \ 7 | -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 8 | -DARCH=himbaechel -DHIMBAECHEL_UARCH=gatemate \ 9 | -DHIMBAECHEL_GATEMATE_DEVICES=all \ 10 | -DHIMBAECHEL_PEPPERCORN_PATH=${BUILD_DIR}/prjpeppercorn \ 11 | -DEXPORT_BBA_FILES=${OUTPUT_DIR}/bba-files \ 12 | -B build 13 | 14 | make -C build nextpnr-all-bba 15 | -------------------------------------------------------------------------------- /default/scripts/ghdl-yosys-plugin.sh: -------------------------------------------------------------------------------- 1 | cd ghdl-yosys-plugin 2 | sed -i 's,/yosyshq/share,/yosys/yosyshq/share,g' ../yosys/yosyshq/bin/yosys-config 3 | if [ ${ARCH} == 'darwin-x64' ] || [ ${ARCH} == 'darwin-arm64' ]; then 4 | sed -i '11,13d' Makefile 5 | make GHDL=../ghdl/yosyshq/bin/ghdl YOSYS_CONFIG=../yosys/yosyshq/bin/yosys-config CFLAGS="-I ../yosys/yosyshq/share/yosys/include" LIBGHDL_LIB="${BUILD_DIR}/ghdl${INSTALL_PREFIX}/lib/libghdl-6_0_0_dev.dylib" LIBGHDL_INC="${BUILD_DIR}/ghdl${INSTALL_PREFIX}/include/" 6 | else 7 | make GHDL=../ghdl/yosyshq/bin/ghdl YOSYS_CONFIG=../yosys/yosyshq/bin/yosys-config CFLAGS="-I ../yosys/yosyshq/share/yosys/include" 8 | fi 9 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/share/yosys/plugins 10 | cp -rf ghdl.so ${OUTPUT_DIR}${INSTALL_PREFIX}/share/yosys/plugins/. 11 | -------------------------------------------------------------------------------- /default/scripts/ghdl.sh: -------------------------------------------------------------------------------- 1 | cd ghdl 2 | param=--with-llvm-config="llvm-config" 3 | sed -i 's,ghdl1-llvm,../bin/ghdl1-llvm,g' configure 4 | if [ ${ARCH} == 'linux-arm64' ]; then 5 | sed -i 's,grt-all libs.vhdl.llvm all.vpi,grt-all all.vpi,g' Makefile.in 6 | sed -i 's,install.llvm.program install.vhdllib,install.llvm.program ,g' Makefile.in 7 | sed -i '130,133d' Makefile.in 8 | export GNATMAKE=${CROSS_NAME}-gnatmake 9 | param=--with-llvm-config='llvm-config' 10 | LDFLAGS=-L/usr/lib/${CROSS_NAME} 11 | elif [ ${ARCH} == 'darwin-x64' ]; then 12 | wget https://github.com/ghdl/ghdl/releases/download/nightly/ghdl-llvm-6.0.0-dev-macos13-x86_64.tar.gz 13 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX} 14 | tar xvfz ghdl-llvm-6.0.0-dev-macos13-x86_64.tar.gz -C ${OUTPUT_DIR}${INSTALL_PREFIX} --strip-components=1 15 | install_name_tool -id @executable_path/../lib/libghdl-6_0_0_dev.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdl-6_0_0_dev.dylib 16 | install_name_tool -id @executable_path/../lib/libghdlvpi.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdlvpi.dylib 17 | install_name_tool -id @executable_path/../lib/libgnat-14.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libgnat-14.dylib 18 | install_name_tool -id @executable_path/../lib/libgcc_s.1.1.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libgcc_s.1.1.dylib 19 | install_name_tool -change @rpath/libgnat-14.dylib @executable_path/../lib/libgnat-14.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdl-6_0_0_dev.dylib 20 | install_name_tool -change @rpath/libgcc_s.1.1.dylib @executable_path/../lib/libgcc_s.1.1.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdl-6_0_0_dev.dylib 21 | install_name_tool -change @rpath/libgcc_s.1.1.dylib @executable_path/../lib/libgcc_s.1.1.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libgnat-14.dylib 22 | rcodesign sign ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdl-6_0_0_dev.dylib 23 | rcodesign sign ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdlvpi.dylib 24 | rcodesign sign ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libgnat-14.dylib 25 | rcodesign sign ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libgcc_s.1.1.dylib 26 | exit 0 27 | elif [ ${ARCH} == 'darwin-arm64' ]; then 28 | wget https://github.com/ghdl/ghdl/releases/download/nightly/ghdl-llvm-6.0.0-dev-macos14-aarch64.tar.gz 29 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX} 30 | tar xvfz ghdl-llvm-6.0.0-dev-macos14-aarch64.tar.gz -C ${OUTPUT_DIR}${INSTALL_PREFIX} --strip-components=1 31 | install_name_tool -id @executable_path/../lib/libghdl-6_0_0_dev.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdl-6_0_0_dev.dylib 32 | install_name_tool -id @executable_path/../lib/libghdlvpi.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdlvpi.dylib 33 | install_name_tool -id @executable_path/../lib/libgnat-14.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libgnat-14.dylib 34 | install_name_tool -id @executable_path/../lib/libgcc_s.1.1.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libgcc_s.1.1.dylib 35 | install_name_tool -change @rpath/libgnat-14.dylib @executable_path/../lib/libgnat-14.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdl-6_0_0_dev.dylib 36 | install_name_tool -change @rpath/libgcc_s.1.1.dylib @executable_path/../lib/libgcc_s.1.1.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdl-6_0_0_dev.dylib 37 | install_name_tool -change @rpath/libgcc_s.1.1.dylib @executable_path/../lib/libgcc_s.1.1.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libgnat-14.dylib 38 | rcodesign sign ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdl-6_0_0_dev.dylib 39 | rcodesign sign ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdlvpi.dylib 40 | rcodesign sign ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libgnat-14.dylib 41 | rcodesign sign ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libgcc_s.1.1.dylib 42 | exit 0 43 | elif [ ${ARCH} == 'windows-x64' ]; then 44 | sed -i 's,grt-all libs.vhdl.llvm all.vpi,grt-all all.vpi,g' Makefile.in 45 | sed -i 's,install.llvm.program install.vhdllib,install.llvm.program ,g' Makefile.in 46 | sed -i '130,133d' Makefile.in 47 | export GNATMAKE=${CROSS_NAME}-gnatmake 48 | sed -i 's,$(LDFLAGS) `$(LLVM_LDFLAGS)`,`$(LLVM_LDFLAGS)` $(LDFLAGS),g' src/ortho/llvm6/Makefile 49 | param=--with-llvm-config="/usr/x86_64-w64-mingw32/bin/llvm-config" 50 | LDFLAGS="-luuid -lole32 -lz -lssp" 51 | fi 52 | ./configure --prefix=${INSTALL_PREFIX} \ 53 | --enable-checks \ 54 | --enable-libghdl \ 55 | --enable-synth \ 56 | ${param} LDFLAGS="${LDFLAGS}" 57 | 58 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} 59 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 60 | 61 | -------------------------------------------------------------------------------- /default/scripts/graphviz.sh: -------------------------------------------------------------------------------- 1 | cd graphviz 2 | if [ ${ARCH} == 'windows-x64' ]; then 3 | git clone https://github.com/garyhouston/rxspencer 4 | pushd rxspencer 5 | cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} 6 | make 7 | cp *.h ../lib/gvc/. 8 | popd 9 | fi 10 | if [ ${ARCH_BASE} == 'darwin' ]; then 11 | sed -i 's,stdc++,c++,g' configure.ac 12 | fi 13 | patch -p1 < ${PATCHES_DIR}/graphviz_fix.diff 14 | ./autogen.sh NOCONFIG 15 | if [ ${ARCH_BASE} == 'darwin' ]; then 16 | export CFLAGS="-Wno-incompatible-function-pointer-types" 17 | fi 18 | ./configure --prefix=${INSTALL_PREFIX} --host=${CROSS_NAME} --build=`gcc -dumpmachine` --enable-shared=no --enable-static=yes --enable-ltdl=no --with-qt=no 19 | if [ ${ARCH} == 'windows-x64' ]; then 20 | echo $'\n#undef GVDLL\n' >> config.h 21 | fi 22 | pushd lib/gvpr && gcc mkdefs.c -o mkdefs && popd 23 | pushd lib/dotgen && make && popd 24 | pushd lib/cdt && make && popd 25 | pushd lib/xdot && make && popd 26 | pushd lib/cgraph && make && popd 27 | pushd lib/pathplan && make && popd 28 | pushd lib/pack && make && popd 29 | pushd lib/label && make && popd 30 | pushd lib/common && make && popd 31 | pushd lib/ortho && make && popd 32 | pushd lib/gvc && make && popd 33 | 34 | pushd plugin/core && make && popd 35 | pushd lib/neatogen && make && popd 36 | pushd lib/twopigen && make && popd 37 | pushd lib/patchwork && make && popd 38 | pushd lib/osage && make && popd 39 | pushd lib/fdpgen && make && popd 40 | pushd lib/sparse && make && popd 41 | pushd lib/rbtree && make && popd 42 | pushd lib/circogen && make && popd 43 | pushd lib/sfdpgen && make && popd 44 | pushd lib/vpsc && make && popd 45 | pushd plugin/neato_layout && make && popd 46 | pushd plugin/dot_layout && make && popd 47 | pushd plugin/pango && make && popd 48 | pushd cmd/dot && make dot_static${EXE} && popd 49 | 50 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/bin 51 | cp cmd/dot/dot_static${EXE} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/dot${EXE} 52 | 53 | -------------------------------------------------------------------------------- /default/scripts/gtkwave.sh: -------------------------------------------------------------------------------- 1 | if [ ${ARCH_BASE} == 'darwin' ]; then 2 | cd gtkwave/gtkwave3-gtk3 3 | sed -i -re "s,@GSETTINGS_RULES@,,g" ./src/Makefile.am 4 | ./autogen.sh 5 | ./configure --prefix=${INSTALL_PREFIX} --host=${CROSS_NAME} --enable-gtk3 --with-tcl=$(xcrun --show-sdk-path)/System/Library/Frameworks/Tcl.framework --with-tk=$(xcrun --show-sdk-path)/System/Library/Frameworks/Tk.framework --disable-dependency-tracking 6 | elif [ ${ARCH_BASE} == 'windows' ]; then 7 | cd gtkwave/gtkwave3-gtk3 8 | sed -i -re "s,@GSETTINGS_RULES@,,g" ./src/Makefile.am 9 | ./autogen.sh 10 | ./configure --prefix=${INSTALL_PREFIX} --host=${CROSS_NAME} --enable-gtk3 MINGW_LDADD="-lcomdlg32" --with-tcl=/usr/x86_64-w64-mingw32/sys-root/mingw/lib --with-tk=/usr/x86_64-w64-mingw32/sys-root/mingw/lib 11 | else 12 | cd gtkwave/gtkwave3-gtk3 13 | ./autogen.sh 14 | ./configure --prefix=${INSTALL_PREFIX} --host=${CROSS_NAME} --enable-gtk3 15 | fi 16 | make DESTDIR=${OUTPUT_DIR} UPDATE_DESKTOP_DATABASE=/bin/true -j${NPROC} install 17 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/share/gtkwave 18 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/share/gtkwave-gtk3 19 | -------------------------------------------------------------------------------- /default/scripts/icestorm-bba.sh: -------------------------------------------------------------------------------- 1 | cd nextpnr 2 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 3 | -DICEBOX_DATADIR=${BUILD_DIR}/icestorm${INSTALL_PREFIX}/share/icebox \ 4 | -DARCH=ice40 \ 5 | -DEXPORT_BBA_FILES=${OUTPUT_DIR}/bba-files \ 6 | -B build 7 | make -C build nextpnr-all-bba 8 | -------------------------------------------------------------------------------- /default/scripts/icestorm.sh: -------------------------------------------------------------------------------- 1 | cd icestorm 2 | sed -i 's,Darwin,XXXXX,g' icebox/Makefile 3 | sed -i 's,CC,CXX,g' iceprog/Makefile 4 | make PREFIX=${INSTALL_PREFIX} DESTDIR=${OUTPUT_DIR} install -j${NPROC} 5 | if [ ${ARCH_BASE} != 'windows' ]; then 6 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/libexec 7 | mv ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/icebox.py ${OUTPUT_DIR}${INSTALL_PREFIX}/libexec/. 8 | mv ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/iceboxdb.py ${OUTPUT_DIR}${INSTALL_PREFIX}/libexec/. 9 | for f in $(find ${OUTPUT_DIR}${INSTALL_PREFIX}/bin -type l) 10 | do 11 | cp --remove-destination $(readlink -e $f) $f 12 | done 13 | else 14 | sed 's|#!/usr/bin/env python3|#|g' -i ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/icebox.py 15 | fi 16 | -------------------------------------------------------------------------------- /default/scripts/imctk.sh: -------------------------------------------------------------------------------- 1 | cd imctk 2 | rm -rf abc-sys/codegen.sh 3 | sed -i 's,debug = true,#debug = true,g' Cargo.toml 4 | sed -i 's,pub const l_False,//pub const l_False,g' abc-sys/src/generated/bindings.rs 5 | cargo install --no-track --path eqy-engine --root ${OUTPUT_DIR}${INSTALL_PREFIX} --target=${CARGO_TARGET} 6 | -------------------------------------------------------------------------------- /default/scripts/iverilog.sh: -------------------------------------------------------------------------------- 1 | cd iverilog 2 | sh autoconf.sh 3 | if [ ${ARCH} == 'windows-x64' ]; then 4 | sed -i 's,@EXEEXT@,.exe,g' vvp/Makefile.in 5 | sed -i 's,@EXEEXT@,.exe,g' ivlpp/Makefile.in 6 | sed -i 's,@EXEEXT@,.exe,g' vhdlpp/Makefile.in 7 | sed -i 's,@EXEEXT@,.exe,g' driver/Makefile.in 8 | sed -i 's,@EXEEXT@,.exe,g' Makefile.in 9 | sed -i 's,@EXEEXT@,.exe,g' driver-vpi/Makefile.in 10 | fi 11 | if [ ${ARCH_BASE} == 'darwin' ]; then 12 | export CFLAGS="-Wno-implicit-function-declaration" 13 | fi 14 | ./configure --prefix=${INSTALL_PREFIX} --host=${CROSS_NAME} 15 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 16 | sed -i -re 's|^flag:VVP_EXECUTABLE=.*$||g' ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/ivl/vvp.conf 17 | sed -i -re 's|^flag:VVP_EXECUTABLE=.*$||g' ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/ivl/vvp-s.conf 18 | -------------------------------------------------------------------------------- /default/scripts/libpoly.sh: -------------------------------------------------------------------------------- 1 | cd libpoly 2 | if [ ${ARCH_BASE} == 'windows' ]; then 3 | # Taken from cvc5 scripts 4 | # Avoid %z and %llu format specifiers 5 | find . -type f ! -name "*.orig" -exec \ 6 | sed -i.orig "s/%z[diu]/%\\\" PRIu64 \\\"/g" {} + 7 | find . -type f ! -name "*.orig" -exec \ 8 | sed -i.orig "s/%ll[du]/%\\\" PRIu64 \\\"/g" {} + 9 | 10 | # Make sure the new macros are available 11 | find . -type f ! -name "*.orig" -exec \ 12 | sed -i.orig "s/#include /#include \\n#include /" {} + 13 | find . -type f ! -name "*.orig" -exec \ 14 | sed -i.orig "s/#include /#include \\n#include /" {} + 15 | fi 16 | sed -i "s,add_subdirectory(test/polyxx),add_subdirectory(test/polyxx EXCLUDE_FROM_ALL),g" CMakeLists.txt 17 | if [ ${ARCH_BASE} == 'darwin' ]; then 18 | sed -i "s,-Wall -Werror -Wextra,-Wall -Wextra,g" src/CMakeLists.txt 19 | fi 20 | cmake -DCMAKE_BUILD_TYPE=Release \ 21 | -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ 22 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 23 | -DLIBPOLY_BUILD_PYTHON_API=OFF \ 24 | -DLIBPOLY_BUILD_STATIC=ON \ 25 | -DLIBPOLY_BUILD_STATIC_PIC=ON 26 | make DESTDIR=${OUTPUT_DIR} install -------------------------------------------------------------------------------- /default/scripts/lingeling.sh: -------------------------------------------------------------------------------- 1 | cd lingeling 2 | if [ ${ARCH_BASE} == 'windows' ]; then 3 | git checkout 03b4860d14016f42213ea271014f2f13d181f504 4 | patch -p1 < ${PATCHES_DIR}/Lingeling_20190110.patch 5 | fi 6 | 7 | ./configure.sh -fPIC 8 | make -j${NPROC} 9 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/include 10 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/lib 11 | cp lglib.h ${OUTPUT_DIR}${INSTALL_PREFIX}/include/. 12 | cp liblgl.a ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/. 13 | -------------------------------------------------------------------------------- /default/scripts/nextpnr-bba.sh: -------------------------------------------------------------------------------- 1 | cd nextpnr/bba 2 | cmake -DCMAKE_BUILD_TYPE=Release -DBoost_USE_STATIC_LIBS=ON -DCMAKE_CXX_STANDARD=14 3 | make -j${NPROC} 4 | sed -i 's,'${BUILD_DIR}','${OUTPUT_DIR}',g' bba-export.cmake 5 | mkdir -p ${OUTPUT_DIR}/nextpnr/bba 6 | cp bbasm ${OUTPUT_DIR}/nextpnr/bba/. 7 | cp bba-export.cmake ${OUTPUT_DIR}/nextpnr/bba/. 8 | -------------------------------------------------------------------------------- /default/scripts/nextpnr-ecp5.sh: -------------------------------------------------------------------------------- 1 | export PATH=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin:$PATH 2 | cd nextpnr 3 | build_gui="OFF" 4 | if [ ${ARCH} == 'linux-x64' ] || [ ${ARCH} == 'windows-x64' ] || [ ${ARCH} == 'darwin-x64' ] || [ ${ARCH} == 'darwin-arm64' ]; then 5 | build_gui="ON" 6 | fi 7 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 8 | -DPython3_INCLUDE_DIR=${BUILD_DIR}/python3${INSTALL_PREFIX}/include/python3.11 \ 9 | -DPython3_LIBRARY=${BUILD_DIR}/python3${INSTALL_PREFIX}/lib/libpython3.11${SHARED_EXT} \ 10 | -DARCH=ecp5 \ 11 | -DIMPORT_BBA_FILES=${BUILD_DIR}/prjtrellis-bba/bba-files \ 12 | -DBUILD_GUI=${build_gui} -DUSE_IPO=OFF \ 13 | -DBBA_IMPORT=${BUILD_DIR}/nextpnr-bba/nextpnr/bba/bba-export.cmake \ 14 | -B build 15 | 16 | make -C build DESTDIR=${OUTPUT_DIR} -j${NPROC} install 17 | 18 | ${STRIP} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/nextpnr-ecp5${EXE} 19 | -------------------------------------------------------------------------------- /default/scripts/nextpnr-generic.sh: -------------------------------------------------------------------------------- 1 | export PATH=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin:$PATH 2 | cd nextpnr 3 | build_gui="OFF" 4 | if [ ${ARCH} == 'linux-x64' ] || [ ${ARCH} == 'windows-x64' ] || [ ${ARCH} == 'darwin-x64' ] || [ ${ARCH} == 'darwin-arm64' ]; then 5 | build_gui="OFF" # No GUI available for now 6 | fi 7 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 8 | -DPython3_INCLUDE_DIR=${BUILD_DIR}/python3${INSTALL_PREFIX}/include/python3.11 \ 9 | -DPython3_LIBRARY=${BUILD_DIR}/python3${INSTALL_PREFIX}/lib/libpython3.11${SHARED_EXT} \ 10 | -DARCH=generic \ 11 | -DBUILD_GUI=${build_gui} -DUSE_IPO=OFF \ 12 | -DBBA_IMPORT=${BUILD_DIR}/nextpnr-bba/nextpnr/bba/bba-export.cmake \ 13 | -B build 14 | 15 | make -C build DESTDIR=${OUTPUT_DIR} -j${NPROC} install 16 | 17 | ${STRIP} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/nextpnr-generic${EXE} 18 | -------------------------------------------------------------------------------- /default/scripts/nextpnr-himbaechel.sh: -------------------------------------------------------------------------------- 1 | export PATH=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin:$PATH 2 | cd nextpnr 3 | mkdir bba-files 4 | cp -rf ${BUILD_DIR}/apicula-bba/bba-files/* bba-files/. 5 | cp -rf ${BUILD_DIR}/gatemate-bba/bba-files/* bba-files/. 6 | build_gui="OFF" 7 | if [ ${ARCH} == 'linux-x64' ] || [ ${ARCH} == 'windows-x64' ] || [ ${ARCH} == 'darwin-x64' ] || [ ${ARCH} == 'darwin-arm64' ]; then 8 | build_gui="ON" 9 | fi 10 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 11 | -DPython3_INCLUDE_DIR=${BUILD_DIR}/python3${INSTALL_PREFIX}/include/python3.11 \ 12 | -DPython3_LIBRARY=${BUILD_DIR}/python3${INSTALL_PREFIX}/lib/libpython3.11${SHARED_EXT} \ 13 | -DARCH=himbaechel -DHIMBAECHEL_UARCH="gowin;gatemate" \ 14 | -DIMPORT_BBA_FILES=${BUILD_DIR}/nextpnr/bba-files \ 15 | -DBUILD_GUI=${build_gui} -DUSE_IPO=OFF \ 16 | -DBBA_IMPORT=${BUILD_DIR}/nextpnr-bba/nextpnr/bba/bba-export.cmake \ 17 | -B build 18 | 19 | make -C build DESTDIR=${OUTPUT_DIR} -j${NPROC} install 20 | 21 | ${STRIP} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/nextpnr-himbaechel${EXE} 22 | -------------------------------------------------------------------------------- /default/scripts/nextpnr-ice40.sh: -------------------------------------------------------------------------------- 1 | export PATH=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin:$PATH 2 | cd nextpnr 3 | build_gui="OFF" 4 | if [ ${ARCH} == 'linux-x64' ] || [ ${ARCH} == 'windows-x64' ] || [ ${ARCH} == 'darwin-x64' ] || [ ${ARCH} == 'darwin-arm64' ]; then 5 | build_gui="ON" 6 | fi 7 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 8 | -DPython3_INCLUDE_DIR=${BUILD_DIR}/python3${INSTALL_PREFIX}/include/python3.11 \ 9 | -DPython3_LIBRARY=${BUILD_DIR}/python3${INSTALL_PREFIX}/lib/libpython3.11${SHARED_EXT} \ 10 | -DARCH=ice40 \ 11 | -DIMPORT_BBA_FILES=${BUILD_DIR}/icestorm-bba/bba-files \ 12 | -DBUILD_GUI=${build_gui} -DUSE_IPO=OFF \ 13 | -DBBA_IMPORT=${BUILD_DIR}/nextpnr-bba/nextpnr/bba/bba-export.cmake \ 14 | -B build 15 | 16 | make -C build DESTDIR=${OUTPUT_DIR} -j${NPROC} install 17 | 18 | ${STRIP} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/nextpnr-ice40${EXE} 19 | -------------------------------------------------------------------------------- /default/scripts/nextpnr-machxo2.sh: -------------------------------------------------------------------------------- 1 | export PATH=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin:$PATH 2 | cd nextpnr 3 | build_gui="OFF" 4 | if [ ${ARCH} == 'linux-x64' ] || [ ${ARCH} == 'windows-x64' ] || [ ${ARCH} == 'darwin-x64' ] || [ ${ARCH} == 'darwin-arm64' ]; then 5 | build_gui="ON" 6 | fi 7 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 8 | -DPython3_INCLUDE_DIR=${BUILD_DIR}/python3${INSTALL_PREFIX}/include/python3.11 \ 9 | -DPython3_LIBRARY=${BUILD_DIR}/python3${INSTALL_PREFIX}/lib/libpython3.11${SHARED_EXT} \ 10 | -DARCH=machxo2 \ 11 | -DIMPORT_BBA_FILES=${BUILD_DIR}/prjtrellis-bba/bba-files \ 12 | -DBUILD_GUI=${build_gui} -DUSE_IPO=OFF \ 13 | -DBBA_IMPORT=${BUILD_DIR}/nextpnr-bba/nextpnr/bba/bba-export.cmake \ 14 | -B build 15 | 16 | make -C build DESTDIR=${OUTPUT_DIR} -j${NPROC} install 17 | 18 | ${STRIP} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/nextpnr-machxo2${EXE} 19 | -------------------------------------------------------------------------------- /default/scripts/nextpnr-mistral.sh: -------------------------------------------------------------------------------- 1 | export PATH=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin:$PATH 2 | cd nextpnr 3 | build_gui="OFF" 4 | if [ ${ARCH} == 'linux-x64' ] || [ ${ARCH} == 'windows-x64' ] || [ ${ARCH} == 'darwin-x64' ] || [ ${ARCH} == 'darwin-arm64' ]; then 5 | build_gui="OFF" # No GUI available for now 6 | fi 7 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 8 | -DPython3_INCLUDE_DIR=${BUILD_DIR}/python3${INSTALL_PREFIX}/include/python3.11 \ 9 | -DPython3_LIBRARY=${BUILD_DIR}/python3${INSTALL_PREFIX}/lib/libpython3.11${SHARED_EXT} \ 10 | -DARCH=mistral \ 11 | -DMISTRAL_ROOT=${BUILD_DIR}/mistral \ 12 | -DBUILD_GUI=${build_gui} -DUSE_IPO=OFF . -DBBA_IMPORT=${BUILD_DIR}/nextpnr-bba/nextpnr/bba/bba-export.cmake 13 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 14 | ${STRIP} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/nextpnr-mistral${EXE} 15 | -------------------------------------------------------------------------------- /default/scripts/nextpnr-nexus.sh: -------------------------------------------------------------------------------- 1 | export PATH=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin:$PATH 2 | cd nextpnr 3 | build_gui="OFF" 4 | if [ ${ARCH} == 'linux-x64' ] || [ ${ARCH} == 'windows-x64' ] || [ ${ARCH} == 'darwin-x64' ] || [ ${ARCH} == 'darwin-arm64' ]; then 5 | build_gui="ON" 6 | fi 7 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 8 | -DPython3_INCLUDE_DIR=${BUILD_DIR}/python3${INSTALL_PREFIX}/include/python3.11 \ 9 | -DPython3_LIBRARY=${BUILD_DIR}/python3${INSTALL_PREFIX}/lib/libpython3.11${SHARED_EXT} \ 10 | -DARCH=nexus \ 11 | -DIMPORT_BBA_FILES=${BUILD_DIR}/prjoxide-bba/bba-files \ 12 | -DBUILD_GUI=${build_gui} -DUSE_IPO=OFF \ 13 | -DBBA_IMPORT=${BUILD_DIR}/nextpnr-bba/nextpnr/bba/bba-export.cmake \ 14 | -B build 15 | 16 | make -C build DESTDIR=${OUTPUT_DIR} -j${NPROC} install 17 | 18 | ${STRIP} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/nextpnr-nexus${EXE} 19 | -------------------------------------------------------------------------------- /default/scripts/numpy.sh: -------------------------------------------------------------------------------- 1 | cd numpy 2 | git submodule update --init 3 | source ${PATCHES_DIR}/python3_package.sh 4 | python3_package_setup 5 | python3_package_pip_install "Cython" 6 | python3_package_install_numpy 7 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python3.11/site-packages/bin 8 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/f2py* 9 | -------------------------------------------------------------------------------- /default/scripts/openfpgaloader.sh: -------------------------------------------------------------------------------- 1 | cd openfpgaloader 2 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DENABLE_UDEV=OFF . 3 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 4 | -------------------------------------------------------------------------------- /default/scripts/picosat.sh: -------------------------------------------------------------------------------- 1 | cd picosat 2 | ./configure.sh 3 | make 4 | mkdir -p ${OUTPUT_DIR}/dev 5 | cp picosat.o ${OUTPUT_DIR}/dev/. 6 | cp picosat.h ${OUTPUT_DIR}/dev/. 7 | cp VERSION ${OUTPUT_DIR}/dev/. 8 | -------------------------------------------------------------------------------- /default/scripts/pono.sh: -------------------------------------------------------------------------------- 1 | mkdir -p pono/deps/smt-switch/local 2 | mkdir -p pono/deps/btor2tools/build/lib 3 | cp -R ${BUILD_DIR}/smt-switch${INSTALL_PREFIX}/* pono/deps/smt-switch/local/. 4 | cp -R ${BUILD_DIR}/boolector/dev/deps/btor2tools/src pono/deps/btor2tools/. 5 | cp -R pono/deps/smt-switch/local/cmake pono/deps/smt-switch/. 6 | cp boolector/dev/deps/btor2tools/build/libbtor2parser.a pono/deps/btor2tools/build/lib/. 7 | cp boolector/dev/deps/lingeling/build/liblgl.a pono/deps/smt-switch/local/lib/. 8 | cp boolector/dev/deps/cadical/build/libcadical.a pono/deps/smt-switch/local/lib/. 9 | cd pono 10 | sed -i -re 's,cmake \"\$root_dir\" \$cmake_opts,cmake \"\$root_dir\" \$cmake_opts -DCMAKE_TOOLCHAIN_FILE=\$\{CMAKE_TOOLCHAIN_FILE\},g' configure.sh 11 | sed -i 's,target_link_libraries(pono-lib PUBLIC "${SMT_SWITCH_DIR}/local/lib/libsmt-switch-btor.a"),target_link_libraries(pono-lib PUBLIC "${SMT_SWITCH_DIR}/local/lib/libsmt-switch-btor.a")\ntarget_link_libraries(pono-lib PUBLIC "${SMT_SWITCH_DIR}/local/lib/liblgl.a")\ntarget_link_libraries(pono-lib PUBLIC "${SMT_SWITCH_DIR}/local/lib/libcadical.a"),g' CMakeLists.txt 12 | sed -i 's,add_subdirectory(tests),#add_subdirectory(tests),g' CMakeLists.txt 13 | if [ ${ARCH_BASE} == 'windows' ]; then 14 | sed -i 's,#include ,#include \n#include ,g' utils/str_util.h 15 | cp ../cvc5/dev/build/src/main/libcvc5.dll.a ../pono/deps/smt-switch/local/lib/. 16 | sed -i 's,target_link_libraries(pono-lib PUBLIC "${SMT_SWITCH_DIR}/local/lib/libsmt-switch-cvc5.a"),target_link_libraries(pono-lib PUBLIC "${SMT_SWITCH_DIR}/local/lib/libsmt-switch-cvc5.a")\ntarget_link_libraries(pono-lib PUBLIC "${SMT_SWITCH_DIR}/local/lib/libcvc5.dll.a"),g' CMakeLists.txt 17 | sed -i -re 's,FMT_USE_WINDOWS_H 1,FMT_USE_WINDOWS_H 0,g' contrib/fmt/format.h 18 | sed -i -re 's,SIGALRM,SIGABRT,g' pono.cpp 19 | fi 20 | ./configure.sh --static-lib 21 | cd build 22 | make -j${NPROC} 23 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/bin 24 | cp pono${EXE} ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/. 25 | -------------------------------------------------------------------------------- /default/scripts/prjoxide-bba.sh: -------------------------------------------------------------------------------- 1 | cd nextpnr 2 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 3 | -DOXIDE_INSTALL_PREFIX=${BUILD_DIR}/prjoxide${INSTALL_PREFIX} \ 4 | -DARCH=nexus \ 5 | -DEXPORT_BBA_FILES=${OUTPUT_DIR}/bba-files \ 6 | -B build 7 | make -C build nextpnr-all-bba 8 | -------------------------------------------------------------------------------- /default/scripts/prjoxide.sh: -------------------------------------------------------------------------------- 1 | cd prjoxide/libprjoxide 2 | cargo install --no-track --path prjoxide --root ${OUTPUT_DIR}${INSTALL_PREFIX} --target=${CARGO_TARGET} 3 | -------------------------------------------------------------------------------- /default/scripts/prjpeppercorn.sh: -------------------------------------------------------------------------------- 1 | cd prjpeppercorn/libgm 2 | sed -i 's,cmake_policy(SET CMP0167 NEW),,g' CMakeLists.txt 3 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ 4 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 5 | . 6 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 7 | -------------------------------------------------------------------------------- /default/scripts/prjtrellis-bba.sh: -------------------------------------------------------------------------------- 1 | pushd prjtrellis/libtrellis 2 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ 3 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DBUILD_PYTHON=ON \ 4 | . 5 | make -j${NPROC} pytrellis 6 | popd 7 | cd nextpnr 8 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ 9 | -DTRELLIS_LIBDIR=${BUILD_DIR}/prjtrellis/libtrellis \ 10 | -DTRELLIS_DATADIR=${BUILD_DIR}/prjtrellis \ 11 | -DARCH="ecp5;machxo2" \ 12 | -DEXPORT_BBA_FILES=${OUTPUT_DIR}/bba-files \ 13 | -B build 14 | make -C build nextpnr-all-bba 15 | -------------------------------------------------------------------------------- /default/scripts/prjtrellis.sh: -------------------------------------------------------------------------------- 1 | cd prjtrellis/libtrellis 2 | sed -i 's,3.31,3.20,g' CMakeLists.txt 3 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ 4 | -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DBUILD_PYTHON=OFF -DBUILD_SHARED=OFF \ 5 | . 6 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 7 | -------------------------------------------------------------------------------- /default/scripts/pyhdl.sh: -------------------------------------------------------------------------------- 1 | source ${PATCHES_DIR}/python3_package.sh 2 | python3_package_setup 3 | python3_package_pip_install "git+https://github.com/amaranth-lang/amaranth" 4 | python3_package_pip_install "git+https://github.com/amaranth-lang/amaranth-boards" 5 | python3_package_pip_install "git+https://github.com/m-labs/migen" 6 | mv ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python3.11/site-packages/bin ${OUTPUT_DIR}${INSTALL_PREFIX}/. 7 | 8 | -------------------------------------------------------------------------------- /default/scripts/python-programmers.sh: -------------------------------------------------------------------------------- 1 | source ${PATCHES_DIR}/python3_package.sh 2 | 3 | cp -r tinyfpgab/programmer/* tinyfpgab/. 4 | cp -r tinyprog/programmer/* tinyprog/. 5 | 6 | python3_package_setup 7 | python3_package_pip_install "rpds-py==0.16.1" 8 | export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse 9 | for target in *; do 10 | if [ $target != 'python3' ] && [ $target != 'python3-native' ]; then 11 | pushd $target 12 | if [ $target == 'tinyprog' ]; then 13 | export SETUPTOOLS_SCM_PRETEND_VERSION="1.0.23" 14 | fi 15 | python3_package_install 16 | popd 17 | fi 18 | done 19 | python3_package_pth "python-programmers" 20 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/tqdm 21 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/jsonschema 22 | for f in ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/*.py 23 | do 24 | [ -f "$f" ] && mv "$f" "${f%.py}" 25 | done -------------------------------------------------------------------------------- /default/scripts/python2-native.sh: -------------------------------------------------------------------------------- 1 | cd python2 2 | patch -p1 < ${PATCHES_DIR}/python27.diff 3 | if [ ${ARCH} == 'darwin-x64' ]; then 4 | export CFLAGS="-I/opt/local/include" 5 | export LDFLAGS="-L/opt/local/lib" 6 | patch -p1 < ${PATCHES_DIR}/python27-darwin.diff 7 | autoreconf -vfi 8 | fi 9 | echo "ac_cv_file__dev_ptmx=no" > config.site 10 | echo "ac_cv_file__dev_ptc=no" >> config.site 11 | CONFIG_SITE=config.site ./configure --prefix=${INSTALL_PREFIX} --host=${CROSS_NAME} --build=`gcc -dumpmachine` --disable-ipv6 --with-system-ffi --with-ensurepip=install 12 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 13 | if [ -d "${OUTPUT_DIR}/usr" ]; then 14 | cp -r ${OUTPUT_DIR}/usr/* ${OUTPUT_DIR}${INSTALL_PREFIX}/. 15 | rm -rf ${OUTPUT_DIR}/usr 16 | fi 17 | 18 | mkdir -p ${OUTPUT_DIR}/dev 19 | mv ${OUTPUT_DIR}${INSTALL_PREFIX}/include ${OUTPUT_DIR}/dev/. 20 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/pkgconfig 21 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python2.7/config/libpython2.7.a -------------------------------------------------------------------------------- /default/scripts/python2.sh: -------------------------------------------------------------------------------- 1 | cd python2 2 | patch -p1 < ${PATCHES_DIR}/python27.diff 3 | if [ ${ARCH} == 'darwin-x64' ]; then 4 | export CFLAGS="-I/opt/local/include" 5 | export LDFLAGS="-L/opt/local/lib" 6 | patch -p1 < ${PATCHES_DIR}/python27-darwin.diff 7 | autoreconf -vfi 8 | fi 9 | echo "ac_cv_file__dev_ptmx=no" > config.site 10 | echo "ac_cv_file__dev_ptc=no" >> config.site 11 | export PATH=${BUILD_DIR}/python2-native${INSTALL_PREFIX}/bin:$PATH 12 | CONFIG_SITE=config.site ./configure --prefix=${INSTALL_PREFIX} --host=${CROSS_NAME} --build=`gcc -dumpmachine` --disable-ipv6 --enable-shared --with-system-ffi --with-ensurepip=install 13 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 14 | if [ -d "${OUTPUT_DIR}/usr" ]; then 15 | cp -r ${OUTPUT_DIR}/usr/* ${OUTPUT_DIR}${INSTALL_PREFIX}/. 16 | rm -rf ${OUTPUT_DIR}/usr 17 | fi 18 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/bin 19 | 20 | export _PYTHON_PROJECT_BASE=${BUILD_DIR}/python2 21 | export PYTHONPATH=${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python2.7:${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python2.7/plat-linux2:${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python2.7/site-packages 22 | export PYTHON2_NATIVE=${BUILD_DIR}/python2-native${INSTALL_PREFIX}/bin/python2.7 23 | pip_cmd="pip install future --target ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python2.7/site-packages --no-cache-dir --disable-pip-version-check" 24 | if [ ${ARCH} == 'linux-arm64' ]; then 25 | _PYTHON_HOST_PLATFORM=linux2-aarch64 ${PYTHON2_NATIVE} -m ${pip_cmd} 26 | elif [ ${ARCH} == 'linux-x64' ]; then 27 | _PYTHON_HOST_PLATFORM=linux2-x64 ${PYTHON2_NATIVE} -m ${pip_cmd} 28 | fi 29 | 30 | mkdir -p ${OUTPUT_DIR}/dev 31 | mv ${OUTPUT_DIR}${INSTALL_PREFIX}/include ${OUTPUT_DIR}/dev/. 32 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/pkgconfig 33 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python2.7/config/libpython2.7.a -------------------------------------------------------------------------------- /default/scripts/python3-native.sh: -------------------------------------------------------------------------------- 1 | cd python3 2 | ./configure --prefix=${INSTALL_PREFIX} -with-ensurepip=install 3 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 4 | rm -f ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/*.a 5 | -------------------------------------------------------------------------------- /default/scripts/python3.sh: -------------------------------------------------------------------------------- 1 | cd python3 2 | if [ ${ARCH_BASE} == 'darwin' ]; then 3 | patch -p1 < ${PATCHES_DIR}/python3.11.6-darwin.diff 4 | sed -e "s|MACOS = (HOST_PLATFORM == 'darwin')|MACOS = (HOST_PLATFORM.startswith('darwin'))|g" -i setup.py 5 | autoreconf -vfi 6 | export CFLAGS="-I/opt/local/include" 7 | export LDFLAGS="-L/opt/local/lib" 8 | echo "ac_cv_file__dev_ptmx=no" > config.site 9 | echo "ac_cv_file__dev_ptc=no" >> config.site 10 | CONFIG_SITE=config.site ./configure --prefix=${INSTALL_PREFIX} --enable-shared --with-system-ffi --with-openssl=/opt/local --host=${CROSS_NAME} --build=`gcc -dumpmachine` --disable-ipv6 --with-build-python=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin/python3.11 11 | elif [ ${ARCH} == 'windows-x64' ]; then 12 | patch -p1 < ${PATCHES_DIR}/python3.11.6-mingw.diff 13 | autoreconf -vfi 14 | # Ensure that we are using the system copy of various libraries rather than copies shipped in the tarball 15 | rm -r Modules/expat 16 | rm -r Modules/_ctypes/{darwin,libffi}* 17 | # Just to be sure that we are using the wanted thread model 18 | rm -f Python/thread_nt.h 19 | echo "ac_cv_file__dev_ptmx=no" > config.site 20 | echo "ac_cv_file__dev_ptc=no" >> config.site 21 | export WINDRES=x86_64-w64-mingw32-windres 22 | CONFIG_SITE=config.site ./configure --prefix=${INSTALL_PREFIX} --host=${CROSS_NAME} --build=`gcc -dumpmachine` \ 23 | --enable-shared \ 24 | --with-system-expat \ 25 | --with-suffix=.exe \ 26 | --enable-loadable-sqlite-extensions \ 27 | --with-ensurepip=no \ 28 | --with-build-python=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin/python3.11 29 | else 30 | echo "ac_cv_file__dev_ptmx=no" > config.site 31 | echo "ac_cv_file__dev_ptc=no" >> config.site 32 | CONFIG_SITE=config.site ./configure --prefix=${INSTALL_PREFIX} --host=${CROSS_NAME} --build=`gcc -dumpmachine` --disable-ipv6 --enable-shared --with-ensurepip=no --with-build-python=${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin/python3.11 33 | fi 34 | 35 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} install 36 | 37 | cp -R ${BUILD_DIR}/python3-native${INSTALL_PREFIX}/lib/python3.11/site-packages/* ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/python3.11/site-packages/. 38 | cp -R ${BUILD_DIR}/python3-native${INSTALL_PREFIX}/bin/pip* ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/. 39 | 40 | mv ${OUTPUT_DIR}${INSTALL_PREFIX}/bin ${OUTPUT_DIR}${INSTALL_PREFIX}/py3bin 41 | if [ ${ARCH_BASE} == 'darwin' ]; then 42 | install_name_tool -id ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libpython3.11.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libpython3.11.dylib 43 | install_name_tool -change ${INSTALL_PREFIX}/lib/libpython3.11.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libpython3.11.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/py3bin/python3.11 44 | elif [ ${ARCH} == 'windows-x64' ]; then 45 | cp ${OUTPUT_DIR}${INSTALL_PREFIX}/py3bin/libpython3.11.dll ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/. 46 | fi 47 | find ${OUTPUT_DIR}${INSTALL_PREFIX} -name "libpython*.a" | xargs rm -rf 48 | -------------------------------------------------------------------------------- /default/scripts/slang.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YosysHQ/oss-cad-suite-build/72b0fddba33eba30fa9935f67bed40cfbc736fe5/default/scripts/slang.sh -------------------------------------------------------------------------------- /default/scripts/smt-switch.sh: -------------------------------------------------------------------------------- 1 | cd smt-switch 2 | sed -i -re 's,target_link_libraries\(smt-switch-btor smt-switch\),target_link_libraries\(smt-switch-btor smt-switch\)\ntarget_link_libraries(smt-switch-btor \"\$\{BTOR_HOME\}/deps/lingeling/build/liblgl.a\"),g' btor/CMakeLists.txt 3 | sed -i -re 's,cmake \"\$root_dir\" \$cmake_opts,cmake \"\$root_dir\" \$cmake_opts -DCMAKE_TOOLCHAIN_FILE=\$\{CMAKE_TOOLCHAIN_FILE\},g' configure.sh 4 | sed -i 's,add_subdirectory(tests),#add_subdirectory(tests),g' CMakeLists.txt 5 | if [ ${ARCH_BASE} == 'windows' ]; then 6 | sed -i 's,#include ,#include \n#include ,g' include/ops.h 7 | patch -p1 < ${PATCHES_DIR}/smt-switch-win32.diff 8 | sed -i -re 's,__APPLE__,__WIN32__,g' src/generic_solver.cpp 9 | sed -i -re 's,__APPLE__,__WIN32__,g' tests/test-generic-solver.cpp 10 | sed -i -re 's,\*.o,\*.obj,g' cvc5/CMakeLists.txt 11 | sed -i -re 's,\*.o,\*.obj,g' btor/CMakeLists.txt 12 | echo > contrib/memstream-0.1/memstream.c 13 | export CMAKE_TOOLCHAIN_FILE=${PATCHES_DIR}/Toolchain-mingw64.cmake 14 | fi 15 | if [ ${ARCH_BASE} == 'darwin' ]; then 16 | sed -i -re 's,linux,l1nux,g' scripts/repack-static-lib.sh 17 | sed -i -re 's,darwin,linux,g' scripts/repack-static-lib.sh 18 | sed -i -re 's,libtool,x86_64-apple-darwin23.5-libtool,g' scripts/repack-static-lib.sh 19 | fi 20 | ./configure.sh --cvc5 --cvc5-home=${BUILD_DIR}/cvc5/dev --btor-home=${BUILD_DIR}/boolector/dev --prefix=${INSTALL_PREFIX} --static --smtlib-reader 21 | cd build 22 | make DESTDIR=${OUTPUT_DIR} -j${NPROC} 23 | make DESTDIR=${OUTPUT_DIR} install 24 | cd .. 25 | cp -R cmake ${OUTPUT_DIR}${INSTALL_PREFIX}/. 26 | -------------------------------------------------------------------------------- /default/scripts/suprove.sh: -------------------------------------------------------------------------------- 1 | cd suprove 2 | patch -p1 < ${PATCHES_DIR}/suprove.diff 3 | if [ ${ARCH} == 'linux-arm64' ]; then 4 | sed -i -re 's,ARCHFLAGS_EXE=\$\{CMAKE_CURRENT_BINARY_DIR\}/abc_arch_flags_program.exe,ARCHFLAGS=\"-DLIN64 -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8 -DSIZEOF_INT=4\",g' abc/CMakeLists.txt 5 | fi 6 | pushd abc-zz 7 | git checkout master 8 | popd 9 | if [ ${PACK_SOURCES} == 'True' ]; then 10 | pushd .. 11 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/src 12 | tar -cf ${OUTPUT_DIR}${INSTALL_PREFIX}/src/suprove.tar suprove 13 | popd 14 | fi 15 | mkdir -p build 16 | cd build 17 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${OUTPUT_DIR}${INSTALL_PREFIX}/super_prove \ 18 | -DPYTHON_EXECUTABLE=/usr/bin/python3 \ 19 | -DPYTHON_INCLUDE_DIR=${BUILD_DIR}/python2/dev/include/python2.7 \ 20 | -DPYTHON_LIBRARY=${BUILD_DIR}/python2${INSTALL_PREFIX}/lib/libpython2.7${SHARED_EXT} \ 21 | .. 22 | make -j${NPROC} 23 | make -j${NPROC} install 24 | mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/bin 25 | cat > ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/suprove < Makefile.conf 9 | echo 'TCL_VERSION := tcl86' >> Makefile.conf 10 | echo 'OS := MINGW' >> Makefile.conf 11 | sed 's|PYTHON := \$(shell cygpath -w -m \$(PREFIX)/bin/python3)|PYTHON := /usr/bin/python3|g' -i backends/smt2/Makefile.inc 12 | else 13 | make config-gcc 14 | sed -i -re "s,CXX = g\+\+,CXX = ${CXX},g" Makefile 15 | fi 16 | make PREFIX=${INSTALL_PREFIX} DESTDIR=${OUTPUT_DIR} install -j${NPROC} 17 | pushd ${OUTPUT_DIR}${INSTALL_PREFIX} 18 | if [ ${ARCH} != 'windows-x64' ]; then 19 | mkdir -p lib 20 | ln -s ../bin/yosys-abc lib/ 21 | fi 22 | popd 23 | -------------------------------------------------------------------------------- /default/scripts/z3.sh: -------------------------------------------------------------------------------- 1 | cd z3 2 | if [ ${ARCH_BASE} == 'windows' ]; then 3 | sed -i 's,IS_LINUX=True,IS_MSYS2=True,g' scripts/mk_util.py 4 | sed -i 's/sysname, _, _, _, machine = os.uname()/sysname,machine=[ "MINGW64", "x86_64"]/g' scripts/mk_util.py 5 | sed -i 's,rewriter.h,rewriter_def.h,g' src/ast/rewriter/push_app_ite.h 6 | sed -i 's,rewriter.h,rewriter_def.h,g' src/ast/rewriter/maximize_ac_sharing.h 7 | fi 8 | if [ ${ARCH_BASE} == 'darwin' ]; then 9 | sed -i 's,IS_LINUX=True,IS_OSX=True,g' scripts/mk_util.py 10 | sed -i 's/sysname, _, _, _, machine = os.uname()/sysname,machine=[ "Darwin", "x86_64"]/g' scripts/mk_util.py 11 | fi 12 | python3 scripts/mk_make.py 13 | cd build 14 | make PREFIX=${INSTALL_PREFIX} DESTDIR=${OUTPUT_DIR} -j${NPROC} 15 | make PREFIX=${INSTALL_PREFIX} DESTDIR=${OUTPUT_DIR} -j${NPROC} install 16 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/include 17 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib 18 | -------------------------------------------------------------------------------- /docker/cross-base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | ENV DEBIAN_FRONTEND=noninteractive 4 | 5 | RUN set -e -x ;\ 6 | apt -y update ;\ 7 | apt -y upgrade ;\ 8 | apt -y install \ 9 | bc \ 10 | unzip \ 11 | rsync \ 12 | bison \ 13 | flex \ 14 | gawk \ 15 | git \ 16 | pkg-config \ 17 | python3 \ 18 | adwaita-icon-theme-full \ 19 | cmake \ 20 | wget \ 21 | gperf \ 22 | autoconf \ 23 | curl \ 24 | pax-utils \ 25 | qt5-qmake \ 26 | qtbase5-dev-tools \ 27 | libtool \ 28 | help2man \ 29 | llvm \ 30 | default-jre-headless; \ 31 | apt -y autoremove ;\ 32 | rm -rf /var/lib/apt/lists/* 33 | 34 | ENV RUSTUP_HOME /opt/rust/rustup 35 | 36 | ENV PATH ${PATH}:/opt/rust/cargo/bin 37 | 38 | RUN curl https://sh.rustup.rs -sSf | RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo bash -s -- --default-toolchain stable --profile default --no-modify-path -y 39 | 40 | WORKDIR /work 41 | -------------------------------------------------------------------------------- /docker/cross-base/build.sh: -------------------------------------------------------------------------------- 1 | docker build -t="yosyshq/cross-base:2.0" . 2 | -------------------------------------------------------------------------------- /docker/cross-darwin-arm64/Dockerfile.21: -------------------------------------------------------------------------------- 1 | FROM yosyshq/cross-darwin-arm64:2.0 2 | 3 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup toolchain install nightly 4 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup override set nightly 5 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup target add aarch64-apple-darwin -------------------------------------------------------------------------------- /docker/cross-darwin-arm64/Toolchain.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Darwin) 2 | set(CMAKE_SYSTEM_VERSION 1) 3 | set(CMAKE_SYSTEM_PROCESSOR aarch64) 4 | 5 | set(CMAKE_C_COMPILER $ENV{CC}) 6 | set(CMAKE_CXX_COMPILER $ENV{CXX}) 7 | 8 | SET(CMAKE_AR $ENV{AR} CACHE FILEPATH "Archiver") 9 | SET(CMAKE_LINKER $ENV{LD} CACHE FILEPATH "Linker") 10 | SET(CMAKE_RANLIB $ENV{RANLIB} CACHE FILEPATH "Ranlib") 11 | 12 | set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) 13 | 14 | SET(CMAKE_OSX_SYSROOT /usr/local/osxcross/target/SDK/MacOSX14.5.sdk/) 15 | SET(CMAKE_EXE_LINKER_FLAGS "-v" CACHE STRING "Flags") 16 | 17 | SET(CMAKE_FIND_ROOT_PATH /usr/local/osxcross/target/macports/pkgs/opt/local/) 18 | 19 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 20 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 21 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 22 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 23 | 24 | set(CMAKE_FIND_ROOT_PATH ${CROSS_PREFIX}) 25 | -------------------------------------------------------------------------------- /docker/cross-darwin-arm64/build.sh: -------------------------------------------------------------------------------- 1 | docker build -t="yosyshq/cross-darwin-arm64:2.2" -f Dockerfile.22 . 2 | -------------------------------------------------------------------------------- /docker/cross-darwin-arm64/gschemas.compiled: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YosysHQ/oss-cad-suite-build/72b0fddba33eba30fa9935f67bed40cfbc736fe5/docker/cross-darwin-arm64/gschemas.compiled -------------------------------------------------------------------------------- /docker/cross-darwin-arm64/uname: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | options=`getopt ahmnprsv $*` 3 | 4 | eval set -- "$options" 5 | 6 | while true 7 | do 8 | case $1 in 9 | -h) 10 | echo "Help" 11 | exit 0 12 | ;; 13 | -a) echo "Darwin" `/usr/bin/uname -n` "21.6.0 Darwin Kernel Version 21.6.0: Thu Nov 9 00:42:02 PST 2023; root:xnu-8020.240.18.705.10~1/RELEASE_ARM64_T8101 arm64" 14 | exit 0 ;; 15 | -m) echo "arm64" 16 | exit 0 ;; 17 | -n) /usr/bin/uname -n 18 | exit 0 ;; 19 | -p) echo "arm" 20 | exit 0 ;; 21 | -r) echo "21.6.0" 22 | exit 0 ;; 23 | -s) echo "Darwin" 24 | exit 0 ;; 25 | -v) echo "Darwin Kernel Version 21.6.0: Thu Nov 9 00:42:02 PST 2023; root:xnu-8020.240.18.705.10~1/RELEASE_ARM64_T8101" 26 | exit 0;; 27 | --) 28 | shift 29 | break;; 30 | *) echo "uname: invalid option" ; exit 1 ;; 31 | esac 32 | shift 33 | done 34 | echo "Darwin" 35 | 36 | -------------------------------------------------------------------------------- /docker/cross-darwin-x64/Dockerfile.21: -------------------------------------------------------------------------------- 1 | FROM yosyshq/cross-darwin-x64:2.0 2 | 3 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup toolchain install nightly 4 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup override set nightly 5 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup target add x86_64-apple-darwin -------------------------------------------------------------------------------- /docker/cross-darwin-x64/Toolchain.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Darwin) 2 | set(CMAKE_SYSTEM_VERSION 1) 3 | set(CMAKE_SYSTEM_PROCESSOR x86_64) 4 | 5 | set(CMAKE_C_COMPILER $ENV{CC}) 6 | set(CMAKE_CXX_COMPILER $ENV{CXX}) 7 | 8 | SET(CMAKE_AR $ENV{AR} CACHE FILEPATH "Archiver") 9 | SET(CMAKE_LINKER $ENV{LD} CACHE FILEPATH "Linker") 10 | SET(CMAKE_RANLIB $ENV{RANLIB} CACHE FILEPATH "Ranlib") 11 | 12 | set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) 13 | 14 | SET(CMAKE_OSX_SYSROOT /usr/local/osxcross/target/SDK/MacOSX14.5.sdk/) 15 | SET(CMAKE_EXE_LINKER_FLAGS "-v" CACHE STRING "Flags") 16 | 17 | SET(CMAKE_FIND_ROOT_PATH /usr/local/osxcross/target/macports/pkgs/opt/local/) 18 | 19 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 20 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 21 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 22 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 23 | 24 | set(CMAKE_FIND_ROOT_PATH ${CROSS_PREFIX}) 25 | -------------------------------------------------------------------------------- /docker/cross-darwin-x64/build.sh: -------------------------------------------------------------------------------- 1 | docker build -t="yosyshq/cross-darwin-x64:2.2" -f Dockerfile.22 . 2 | -------------------------------------------------------------------------------- /docker/cross-darwin-x64/gschemas.compiled: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YosysHQ/oss-cad-suite-build/72b0fddba33eba30fa9935f67bed40cfbc736fe5/docker/cross-darwin-x64/gschemas.compiled -------------------------------------------------------------------------------- /docker/cross-darwin-x64/uname: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | options=`getopt ahmnprsv $*` 3 | 4 | eval set -- "$options" 5 | 6 | while true 7 | do 8 | case $1 in 9 | -h) 10 | echo "Help" 11 | exit 0 12 | ;; 13 | -a) echo "Darwin" `/usr/bin/uname -n` "21.6.0 Darwin Kernel Version 21.6.0: Thu Nov 9 00:38:19 PST 2023; root:xnu-8020.240.18.705.10~1/RELEASE_X86_64 x86_64" 14 | exit 0 ;; 15 | -m) echo "x86_64" 16 | exit 0 ;; 17 | -n) /usr/bin/uname -n 18 | exit 0 ;; 19 | -p) echo "i386" 20 | exit 0 ;; 21 | -r) echo "21.6.0" 22 | exit 0 ;; 23 | -s) echo "Darwin" 24 | exit 0 ;; 25 | -v) echo "Darwin Kernel Version 21.6.0: Thu Nov 9 00:38:19 PST 2023; root:xnu-8020.240.18.705.10~1/RELEASE_X86_64" 26 | exit 0;; 27 | --) 28 | shift 29 | break;; 30 | *) echo "uname: invalid option" ; exit 1 ;; 31 | esac 32 | shift 33 | done 34 | echo "Darwin" 35 | 36 | -------------------------------------------------------------------------------- /docker/cross-linux-arm64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM yosyshq/cross-base:2.0 2 | 3 | ENV CROSS_NAME aarch64-linux-gnu 4 | 5 | ENV CROSS_PREFIX /opt/${CROSS_NAME} 6 | 7 | RUN set -e -x ;\ 8 | apt -y update ;\ 9 | apt -y upgrade ;\ 10 | apt -y install \ 11 | gcc-aarch64-linux-gnu \ 12 | g++-aarch64-linux-gnu \ 13 | gnat-9-aarch64-linux-gnu \ 14 | libc6-dev-arm64-cross; \ 15 | echo 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main multiverse restricted universe' > /etc/apt/sources.list ; \ 16 | echo 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main multiverse restricted universe' >> /etc/apt/sources.list ; \ 17 | echo 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main multiverse restricted universe' >> /etc/apt/sources.list ; \ 18 | echo 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-security main multiverse restricted universe' >> /etc/apt/sources.list ; \ 19 | echo 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main multiverse restricted universe' >> /etc/apt/sources.list ; \ 20 | echo 'deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security main multiverse restricted universe' >> /etc/apt/sources.list ; \ 21 | dpkg --add-architecture arm64 ;\ 22 | apt -y update ;\ 23 | apt -y upgrade ;\ 24 | apt -y install \ 25 | libboost-dev:arm64 \ 26 | libboost-filesystem-dev:arm64 \ 27 | libboost-thread-dev:arm64 \ 28 | libboost-iostreams-dev:arm64 \ 29 | libboost-program-options-dev:arm64 \ 30 | libeigen3-dev:arm64 \ 31 | libffi-dev:arm64 \ 32 | libftdi1-dev:arm64 \ 33 | libgmp-dev:arm64 \ 34 | libgtk-3-dev:arm64 \ 35 | liblzma-dev:arm64 \ 36 | libreadline-dev:arm64 \ 37 | libsqlite3-dev:arm64 \ 38 | libssl-dev:arm64 \ 39 | tcl-dev:arm64 \ 40 | tk-dev:arm64 \ 41 | qtbase5-dev:arm64 \ 42 | libbison-dev:arm64 \ 43 | libhidapi-dev:arm64 \ 44 | libcurl4-openssl-dev:arm64 \ 45 | libbz2-dev:arm64 \ 46 | libllvm14:arm64 \ 47 | libltdl-dev:arm64 \ 48 | libedit-dev:arm64; \ 49 | apt -y autoremove ;\ 50 | rm -rf /var/lib/apt/lists/* 51 | 52 | ENV AS=/usr/bin/${CROSS_NAME}-as \ 53 | AR=/usr/bin/${CROSS_NAME}-ar \ 54 | CC=/usr/bin/${CROSS_NAME}-gcc \ 55 | CPP=/usr/bin/${CROSS_NAME}-cpp \ 56 | CXX=/usr/bin/${CROSS_NAME}-g++ \ 57 | LD=/usr/bin/${CROSS_NAME}-ld \ 58 | STRIP=/usr/bin/${CROSS_NAME}-strip 59 | 60 | COPY Toolchain.cmake ${CROSS_PREFIX}/ 61 | 62 | ENV CMAKE_TOOLCHAIN_FILE ${CROSS_PREFIX}/Toolchain.cmake 63 | 64 | ENV PKG_CONFIG_PATH /usr/lib/aarch64-linux-gnu/pkgconfig 65 | 66 | RUN rustup target add aarch64-unknown-linux-gnu && \ 67 | mkdir -p /.cargo && \ 68 | echo "[target.aarch64-unknown-linux-gnu]" > /.cargo/config && \ 69 | echo "linker = \"aarch64-linux-gnu-gcc\"" >> /.cargo/config 70 | 71 | RUN wget http://ports.ubuntu.com/pool/main/g/gobject-introspection/libgirepository1.0-dev_1.72.0-1_arm64.deb && \ 72 | dpkg-deb -xv libgirepository1.0-dev_1.72.0-1_arm64.deb / && \ 73 | rm -rf libgirepository1.0-dev_1.72.0-1_arm64.deb && \ 74 | wget http://ports.ubuntu.com/pool/main/g/gobject-introspection/gir1.2-glib-2.0_1.72.0-1_arm64.deb && \ 75 | dpkg-deb -xv gir1.2-glib-2.0_1.72.0-1_arm64.deb / && \ 76 | rm -rf gir1.2-glib-2.0_1.72.0-1_arm64.deb 77 | -------------------------------------------------------------------------------- /docker/cross-linux-arm64/Dockerfile.21: -------------------------------------------------------------------------------- 1 | FROM yosyshq/cross-linux-arm64:2.0 2 | 3 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup toolchain install nightly 4 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup override set nightly 5 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup target add aarch64-unknown-linux-gnu 6 | -------------------------------------------------------------------------------- /docker/cross-linux-arm64/Dockerfile.22: -------------------------------------------------------------------------------- 1 | FROM yosyshq/cross-linux-arm64:2.1 2 | 3 | RUN apt purge --auto-remove cmake -y ;\ 4 | wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null ;\ 5 | echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null ;\ 6 | apt-get update -y ;\ 7 | apt-get install cmake -y;\ 8 | apt -y autoremove ;\ 9 | rm -rf /var/lib/apt/lists/* 10 | -------------------------------------------------------------------------------- /docker/cross-linux-arm64/Toolchain.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Linux) 2 | set(CMAKE_SYSTEM_VERSION 1) 3 | set(CMAKE_SYSTEM_PROCESSOR aarch64) 4 | 5 | set(CMAKE_C_COMPILER $ENV{CC}) 6 | set(CMAKE_CXX_COMPILER $ENV{CXX}) 7 | set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) 8 | 9 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 10 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 11 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 12 | 13 | set(CMAKE_FIND_ROOT_PATH ${CROSS_PREFIX}) 14 | -------------------------------------------------------------------------------- /docker/cross-linux-arm64/build.sh: -------------------------------------------------------------------------------- 1 | docker build -t="yosyshq/cross-linux-arm64:2.2" -f Dockerfile.22 . 2 | -------------------------------------------------------------------------------- /docker/cross-linux-x64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM yosyshq/cross-base:2.0 2 | 3 | ENV CROSS_NAME x86_64-linux-gnu 4 | 5 | ENV CROSS_PREFIX /opt/${CROSS_NAME} 6 | 7 | RUN set -e -x ;\ 8 | apt -y update ;\ 9 | apt -y upgrade ;\ 10 | apt -y install \ 11 | gcc \ 12 | g++ \ 13 | clang \ 14 | gnat \ 15 | python3-dev \ 16 | libboost-dev \ 17 | libboost-filesystem-dev \ 18 | libboost-thread-dev \ 19 | libboost-iostreams-dev \ 20 | libboost-program-options-dev \ 21 | libeigen3-dev \ 22 | libffi-dev \ 23 | libftdi1-dev \ 24 | libgmp-dev \ 25 | libgtk-3-dev \ 26 | liblzma-dev \ 27 | libreadline-dev \ 28 | libsqlite3-dev \ 29 | libssl-dev \ 30 | tcl-dev \ 31 | tk-dev \ 32 | qtbase5-dev \ 33 | libbison-dev \ 34 | libhidapi-dev \ 35 | libcurl4-openssl-dev \ 36 | libbz2-dev \ 37 | libltdl-dev \ 38 | libedit-dev; \ 39 | apt -y autoremove ;\ 40 | rm -rf /var/lib/apt/lists/* 41 | 42 | ENV AS=/usr/bin/${CROSS_NAME}-as \ 43 | AR=/usr/bin/${CROSS_NAME}-ar \ 44 | CC=/usr/bin/${CROSS_NAME}-gcc \ 45 | CPP=/usr/bin/${CROSS_NAME}-cpp \ 46 | CXX=/usr/bin/${CROSS_NAME}-g++ \ 47 | LD=/usr/bin/${CROSS_NAME}-ld \ 48 | STRIP=/usr/bin/${CROSS_NAME}-strip 49 | 50 | RUN wget http://archive.ubuntu.com/ubuntu/pool/main/g/gobject-introspection/libgirepository1.0-dev_1.72.0-1_amd64.deb && \ 51 | dpkg-deb -xv libgirepository1.0-dev_1.72.0-1_amd64.deb / && \ 52 | rm -rf libgirepository1.0-dev_1.72.0-1_amd64.deb && \ 53 | wget http://archive.ubuntu.com/ubuntu/pool/main/g/gobject-introspection/gir1.2-glib-2.0_1.72.0-1_amd64.deb && \ 54 | dpkg-deb -xv gir1.2-glib-2.0_1.72.0-1_amd64.deb / && \ 55 | rm -rf gir1.2-glib-2.0_1.72.0-1_amd64.deb 56 | 57 | RUN ln -s /lib64/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3 58 | -------------------------------------------------------------------------------- /docker/cross-linux-x64/Dockerfile.21: -------------------------------------------------------------------------------- 1 | FROM yosyshq/cross-linux-x64:2.0 2 | 3 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup toolchain install nightly 4 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup override set nightly 5 | -------------------------------------------------------------------------------- /docker/cross-linux-x64/Dockerfile.22: -------------------------------------------------------------------------------- 1 | FROM yosyshq/cross-base:2.0 2 | 3 | ENV CROSS_NAME x86_64-linux-gnu 4 | 5 | ENV CROSS_PREFIX /opt/${CROSS_NAME} 6 | 7 | RUN set -e -x ;\ 8 | apt -y update ;\ 9 | apt -y upgrade ;\ 10 | apt -y install \ 11 | lsb-release \ 12 | wget \ 13 | software-properties-common \ 14 | gnupg \ 15 | gcc \ 16 | g++ \ 17 | gnat \ 18 | python3-dev \ 19 | libboost-dev \ 20 | libboost-filesystem-dev \ 21 | libboost-thread-dev \ 22 | libboost-iostreams-dev \ 23 | libboost-program-options-dev \ 24 | libeigen3-dev \ 25 | libffi-dev \ 26 | libftdi1-dev \ 27 | libgmp-dev \ 28 | libgtk-3-dev \ 29 | liblzma-dev \ 30 | libreadline-dev \ 31 | libsqlite3-dev \ 32 | libssl-dev \ 33 | tcl-dev \ 34 | tk-dev \ 35 | qtbase5-dev \ 36 | libbison-dev \ 37 | libhidapi-dev \ 38 | libcurl4-openssl-dev \ 39 | libbz2-dev \ 40 | libltdl-dev \ 41 | libedit-dev; \ 42 | apt -y autoremove ;\ 43 | rm -rf /var/lib/apt/lists/* 44 | 45 | 46 | RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 18 && \ 47 | update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100 &&\ 48 | update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 49 | 50 | ENV AS=/usr/bin/${CROSS_NAME}-as \ 51 | AR=/usr/bin/${CROSS_NAME}-ar \ 52 | CC=/usr/bin/${CROSS_NAME}-gcc \ 53 | CPP=/usr/bin/${CROSS_NAME}-cpp \ 54 | CXX=/usr/bin/${CROSS_NAME}-g++ \ 55 | LD=/usr/bin/${CROSS_NAME}-ld \ 56 | STRIP=/usr/bin/${CROSS_NAME}-strip 57 | 58 | RUN wget http://archive.ubuntu.com/ubuntu/pool/main/g/gobject-introspection/libgirepository1.0-dev_1.72.0-1_amd64.deb && \ 59 | dpkg-deb -xv libgirepository1.0-dev_1.72.0-1_amd64.deb / && \ 60 | rm -rf libgirepository1.0-dev_1.72.0-1_amd64.deb && \ 61 | wget http://archive.ubuntu.com/ubuntu/pool/main/g/gobject-introspection/gir1.2-glib-2.0_1.72.0-1_amd64.deb && \ 62 | dpkg-deb -xv gir1.2-glib-2.0_1.72.0-1_amd64.deb / && \ 63 | rm -rf gir1.2-glib-2.0_1.72.0-1_amd64.deb 64 | 65 | RUN ln -s /lib64/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3 66 | 67 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup toolchain install nightly 68 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup override set nightly 69 | 70 | RUN apt purge --auto-remove cmake -y ;\ 71 | wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null ;\ 72 | echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null ;\ 73 | apt-get update -y ;\ 74 | apt-get install cmake -y;\ 75 | apt -y autoremove ;\ 76 | rm -rf /var/lib/apt/lists/* 77 | -------------------------------------------------------------------------------- /docker/cross-linux-x64/build.sh: -------------------------------------------------------------------------------- 1 | docker build -t="yosyshq/cross-linux-x64:2.2" -f Dockerfile.22 . 2 | -------------------------------------------------------------------------------- /docker/cross-windows-x64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM fedora:39 2 | 3 | RUN dnf install -y mingw64-gcc \ 4 | mingw64-gcc-c++ \ 5 | mingw64-libftdi \ 6 | mingw64-boost \ 7 | mingw64-pkg-config \ 8 | mingw64-tcl \ 9 | mingw64-readline \ 10 | mingw64-tk \ 11 | mingw64-xz \ 12 | mingw64-gtk3 \ 13 | mingw64-qt5-qtbase \ 14 | mingw64-eigen3 \ 15 | mingw64-dlfcn \ 16 | mingw64-hidapi \ 17 | mingw64-bzip2 \ 18 | mingw64-curl \ 19 | git \ 20 | cmake \ 21 | autoconf \ 22 | autoconf-archive \ 23 | automake \ 24 | flex \ 25 | bison \ 26 | patch \ 27 | gperf \ 28 | binutils \ 29 | gcc \ 30 | g++ \ 31 | bc \ 32 | rsync \ 33 | python3 \ 34 | which \ 35 | libtool \ 36 | libtool-ltdl-devel \ 37 | diffutils \ 38 | java-11-openjdk-headless \ 39 | cpio \ 40 | xz \ 41 | help2man \ 42 | wget boost-devel 43 | 44 | RUN git clone --recursive https://github.com/gsauthof/pe-util && \ 45 | cd pe-util && \ 46 | CC=gcc CXX=g++ LD=g++ cmake . && \ 47 | make install -j9 48 | 49 | ENV CROSS_NAME x86_64-w64-mingw32 50 | 51 | ENV AS=/usr/bin/${CROSS_NAME}-as \ 52 | AR=/usr/bin/${CROSS_NAME}-ar \ 53 | CC=/usr/bin/${CROSS_NAME}-gcc \ 54 | CPP=/usr/bin/${CROSS_NAME}-cpp \ 55 | CXX=/usr/bin/${CROSS_NAME}-g++ \ 56 | LD=/usr/bin/${CROSS_NAME}-ld \ 57 | STRIP=/usr/bin/${CROSS_NAME}-strip 58 | 59 | ENV PKG_CONFIG_PATH /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig 60 | 61 | ENV CROSS_PREFIX /opt/${CROSS_NAME} 62 | 63 | RUN cp /usr/include/FlexLexer.h /usr/x86_64-w64-mingw32/sys-root/mingw/include/. 64 | 65 | COPY Toolchain.cmake ${CROSS_PREFIX}/ 66 | 67 | ENV CMAKE_TOOLCHAIN_FILE ${CROSS_PREFIX}/Toolchain.cmake 68 | 69 | ENV RUSTUP_HOME /opt/rust/rustup 70 | 71 | ENV PATH ${PATH}:/opt/rust/cargo/bin 72 | 73 | RUN curl https://sh.rustup.rs -sSf | RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo bash -s -- --default-toolchain stable --profile default --no-modify-path -y 74 | 75 | RUN rustup target add x86_64-pc-windows-gnu && \ 76 | mkdir -p /.cargo && \ 77 | echo "[target.x86_64-pc-windows-gnu]" > /.cargo/config && \ 78 | echo "linker = \"x86_64-w64-mingw32-gcc\"" >> /.cargo/config && \ 79 | echo "ar = \"x86_64-w64-mingw32-ar\"" >> /.cargo/config 80 | 81 | RUN ln -s /usr/bin/python3 /usr/bin/python 82 | 83 | RUN cd /tmp \ 84 | && curl -L https://dl.fedoraproject.org/pub/fedora/linux/releases/39/Everything/source/tree/Packages/m/mingw-gmp-6.1.2-16.fc39.src.rpm --output mingw-gmp-6.1.2-16.fc39.src.rpm \ 85 | && rpm2cpio mingw-gmp-6.1.2-16.fc39.src.rpm | cpio -idmv \ 86 | && tar -xf gmp-6.1.2.tar.xz \ 87 | && cd gmp-6.1.2 \ 88 | && mingw64-configure --disable-shared --enable-cxx --enable-static \ 89 | && mingw64-make -j9 \ 90 | && mingw64-make install \ 91 | && curl http://ftp.gnu.org/gnu/bison/bison-3.5.tar.gz --output /tmp/bison-3.5.tar.gz \ 92 | && curl -L https://raw.githubusercontent.com/reactos/RosBE/master/Patches/bison-3.5-reactos-fix-win32-build.patch --output /tmp/bison.patch \ 93 | && cd /tmp \ 94 | && tar -xzf bison-3.5.tar.gz \ 95 | && cd bison-3.5 \ 96 | && patch -p1 < /tmp/bison.patch \ 97 | && mingw64-configure \ 98 | && mingw64-make -j9 \ 99 | && mingw64-make install \ 100 | && rm -rf /tmp/* \ 101 | && true 102 | 103 | WORKDIR /work 104 | -------------------------------------------------------------------------------- /docker/cross-windows-x64/Dockerfile.21: -------------------------------------------------------------------------------- 1 | FROM yosyshq/cross-windows-x64:2.0 2 | 3 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup toolchain install nightly 4 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup override set nightly 5 | RUN RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo rustup target add x86_64-pc-windows-gnu 6 | RUN dnf install -y openssl -------------------------------------------------------------------------------- /docker/cross-windows-x64/Dockerfile.22: -------------------------------------------------------------------------------- 1 | FROM yosyshq/cross-windows-x64:2.1 2 | -------------------------------------------------------------------------------- /docker/cross-windows-x64/Toolchain.cmake: -------------------------------------------------------------------------------- 1 | SET(CMAKE_SYSTEM_NAME Windows) 2 | SET(CMAKE_SYSTEM_PROCESSOR x86_64) 3 | 4 | SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc) 5 | SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++) 6 | 7 | SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32/sys-root/mingw) 8 | 9 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 10 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 12 | 13 | SET(QT_BINARY_DIR /usr/x86_64-w64-mingw32/bin /usr/bin) 14 | 15 | SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres) 16 | 17 | SET(CMAKE_AR:FILEPATH /usr/bin/x86_64-w64-mingw32-ar) 18 | SET(CMAKE_RANLIB:FILEPATH /usr/bin/x86_64-w64-mingw32-ranlib) 19 | 20 | SET(CMAKE_PREFIX_PATH /usr/x86_64-w64-mingw32/sys-root/mingw/share/cmake/Modules) 21 | 22 | set(Boost_ARCHITECTURE "-x64") 23 | -------------------------------------------------------------------------------- /docker/cross-windows-x64/build.sh: -------------------------------------------------------------------------------- 1 | docker build -t="yosyshq/cross-windows-x64:2.2" -f Dockerfile.22 . 2 | -------------------------------------------------------------------------------- /docker/delete_containers.sh: -------------------------------------------------------------------------------- 1 | docker rm $(docker ps -a -q) 2 | -------------------------------------------------------------------------------- /docker/delete_dangling_images.sh: -------------------------------------------------------------------------------- 1 | docker rmi $(docker images -f "dangling=true" -q) 2 | -------------------------------------------------------------------------------- /libvcs/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /libvcs/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2014-2017 libvcs contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /libvcs/__about__.py: -------------------------------------------------------------------------------- 1 | __title__ = 'libvcs' 2 | __package_name__ = 'libvcs' 3 | __description__ = 'vcs abstraction layer' 4 | __version__ = '0.5.0' 5 | __author__ = 'Tony Narlock' 6 | __github__ = 'https://github.com/vcs-python/libvcs' 7 | __docs__ = 'https://libvcs.git-pull.com' 8 | __tracker__ = 'https://github.com/vcs-python/libvcs/issues' 9 | __pypi__ = 'https://pypi.org/project/libvcs/' 10 | __email__ = 'tony@git-pull.com' 11 | __license__ = 'MIT' 12 | __copyright__ = 'Copyright 2016- Tony Narlock' 13 | -------------------------------------------------------------------------------- /libvcs/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Repo package for libvcs.""" 3 | from __future__ import absolute_import, print_function, unicode_literals 4 | 5 | import logging 6 | 7 | from .base import BaseRepo, RepoLoggingAdapter 8 | from .git import GitRepo 9 | from .hg import MercurialRepo 10 | from .svn import SubversionRepo 11 | 12 | __all__ = [ 13 | 'GitRepo', 14 | 'MercurialRepo', 15 | 'SubversionRepo', 16 | 'BaseRepo', 17 | 'RepoLoggingAdapter', 18 | ] 19 | 20 | logger = logging.getLogger(__name__) 21 | -------------------------------------------------------------------------------- /libvcs/_compat.py: -------------------------------------------------------------------------------- 1 | # flake8: NOQA 2 | import sys 3 | 4 | PY2 = sys.version_info[0] == 2 5 | 6 | _identity = lambda x: x 7 | 8 | 9 | if PY2: 10 | unichr = unichr 11 | text_type = unicode 12 | string_types = (str, unicode) 13 | from urllib import urlretrieve 14 | 15 | iterkeys = lambda d: d.iterkeys() 16 | itervalues = lambda d: d.itervalues() 17 | iteritems = lambda d: d.iteritems() 18 | 19 | import ConfigParser as configparser 20 | import cPickle as pickle 21 | from cStringIO import StringIO as BytesIO 22 | from StringIO import StringIO 23 | 24 | cmp = cmp 25 | 26 | input = raw_input 27 | from string import lower as ascii_lowercase 28 | 29 | import urlparse 30 | 31 | def console_to_str(s): 32 | return s.decode('utf_8') 33 | 34 | def implements_to_string(cls): 35 | cls.__unicode__ = cls.__str__ 36 | cls.__str__ = lambda x: x.__unicode__().encode('utf-8') 37 | return cls 38 | 39 | 40 | else: 41 | unichr = chr 42 | text_type = str 43 | string_types = (str,) 44 | 45 | iterkeys = lambda d: iter(d.keys()) 46 | itervalues = lambda d: iter(d.values()) 47 | iteritems = lambda d: iter(d.items()) 48 | 49 | import configparser 50 | import pickle 51 | from io import BytesIO, StringIO 52 | 53 | cmp = lambda a, b: (a > b) - (a < b) 54 | 55 | input = input 56 | import urllib.parse as urllib 57 | import urllib.parse as urlparse 58 | from string import ascii_lowercase 59 | from urllib.request import urlretrieve 60 | 61 | console_encoding = sys.__stdout__.encoding 62 | 63 | implements_to_string = _identity 64 | 65 | def console_to_str(s): 66 | """ From pypa/pip project, pip.backwardwardcompat. License MIT. """ 67 | try: 68 | return s.decode(console_encoding) 69 | except UnicodeDecodeError: 70 | return s.decode('utf_8') 71 | except AttributeError: # for tests, #13 72 | return s 73 | -------------------------------------------------------------------------------- /libvcs/base.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Base class for Repository objects.""" 3 | from __future__ import absolute_import, print_function, unicode_literals 4 | 5 | import logging 6 | import os 7 | 8 | from ._compat import implements_to_string, urlparse 9 | from .util import RepoLoggingAdapter, mkdir_p, run 10 | 11 | logger = logging.getLogger(__name__) 12 | 13 | 14 | @implements_to_string 15 | class BaseRepo(RepoLoggingAdapter, object): 16 | 17 | """Base class for repositories. 18 | 19 | Extends :py:class:`logging.LoggerAdapter`. 20 | """ 21 | 22 | #: log command output to buffer 23 | log_in_real_time = None 24 | 25 | #: vcs app name, e.g. 'git' 26 | bin_name = '' 27 | 28 | def __init__(self, url, repo_dir, progress_callback=None, *args, **kwargs): 29 | """ 30 | Parameters 31 | ---------- 32 | callback : func 33 | Retrieve live progress from ``sys.stderr`` (useful for certain vcs commands 34 | like ``git pull``. Use ``progress_callback``: 35 | 36 | >>> def progress_cb(output, timestamp): 37 | >>> sys.stdout.write(output) 38 | >>> sys.stdout.flush() 39 | >>> create_repo(..., progress_callback=progress_cb) 40 | """ 41 | self.progress_callback = progress_callback 42 | self.url = url 43 | self.parent_dir = os.path.dirname(repo_dir) 44 | self.repo_name = os.path.basename(os.path.normpath(repo_dir)) 45 | self.path = repo_dir 46 | 47 | # Register more schemes with urlparse for various version control 48 | # systems 49 | if hasattr(self, 'schemes'): 50 | urlparse.uses_netloc.extend(self.schemes) 51 | # Python >= 2.7.4, 3.3 doesn't have uses_fragment 52 | if getattr(urlparse, 'uses_fragment', None): 53 | urlparse.uses_fragment.extend(self.schemes) 54 | 55 | RepoLoggingAdapter.__init__(self, logger, {}) 56 | 57 | @classmethod 58 | def from_pip_url(cls, pip_url, *args, **kwargs): 59 | url, rev = cls.get_url_and_revision_from_pip_url(pip_url) 60 | self = cls(url=url, rev=rev, *args, **kwargs) 61 | 62 | return self 63 | 64 | def run( 65 | self, 66 | cmd, 67 | cwd=None, 68 | check_returncode=True, 69 | log_in_real_time=None, 70 | *args, 71 | **kwargs 72 | ): 73 | """Return combined stderr/stdout from a command. 74 | 75 | This method will also prefix the VCS command bin_name. By default runs 76 | using the cwd `libvcs.base.BaseRepo.path` of the repo. 77 | 78 | Parameters 79 | ---------- 80 | cwd : str 81 | dir command is run from, defaults to `libvcs.base.BaseRepo.path`. 82 | 83 | check_returncode : bool 84 | Indicate whether a :exc:`~exc.CommandError` should be raised if return code 85 | is different from 0. 86 | 87 | Returns 88 | ------- 89 | str 90 | combined stdout/stderr in a big string, newlines retained 91 | """ 92 | 93 | if cwd is None: 94 | cwd = getattr(self, 'path', None) 95 | 96 | cmd = [self.bin_name] + cmd 97 | 98 | return run( 99 | cmd, 100 | callback=( 101 | self.progress_callback if callable(self.progress_callback) else None 102 | ), 103 | check_returncode=check_returncode, 104 | log_in_real_time=log_in_real_time or self.log_in_real_time, 105 | cwd=cwd, 106 | ) 107 | 108 | def check_destination(self, *args, **kwargs): 109 | """Assure destination path exists. If not, create directories.""" 110 | if os.path.exists(self.path): 111 | return True 112 | 113 | if not os.path.exists(self.parent_dir): 114 | mkdir_p(self.parent_dir) 115 | 116 | if not os.path.exists(self.path): 117 | self.debug( 118 | 'Repo directory for %s does not exist @ %s' 119 | % (self.repo_name, self.path) 120 | ) 121 | mkdir_p(self.path) 122 | 123 | return True 124 | 125 | @classmethod 126 | def get_url_and_revision_from_pip_url(cls, pip_url): 127 | """Return repo URL and revision by parsing `libvcs.base.BaseRepo.url`.""" 128 | error_message = ( 129 | "Sorry, '%s' is a malformed VCS url. " 130 | "The format is +://, " 131 | "e.g. svn+http://myrepo/svn/MyApp#egg=MyApp" 132 | ) 133 | assert '+' in pip_url, error_message % pip_url 134 | url = pip_url.split('+', 1)[1] 135 | scheme, netloc, path, query, frag = urlparse.urlsplit(url) 136 | rev = None 137 | if '@' in path: 138 | path, rev = path.rsplit('@', 1) 139 | url = urlparse.urlunsplit((scheme, netloc, path, query, '')) 140 | return url, rev 141 | 142 | def __repr__(self): 143 | return "<{} {}>".format(self.__class__.__name__, self.repo_name) 144 | -------------------------------------------------------------------------------- /libvcs/exc.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Exceptions for libvcs. 3 | 4 | If you see this, we're publishing to S3 automatically 5 | 6 | """ 7 | from __future__ import absolute_import, print_function, unicode_literals 8 | 9 | 10 | class LibVCSException(Exception): 11 | """Standard exception raised by libvcs.""" 12 | 13 | pass 14 | 15 | 16 | class CommandError(LibVCSException): 17 | """This exception is raised on non-zero return codes.""" 18 | 19 | def __init__(self, output, returncode=None, cmd=None): 20 | self.returncode = returncode 21 | self.output = output 22 | if cmd: 23 | if isinstance(cmd, list): 24 | cmd = ' '.join(cmd) 25 | self.cmd = cmd 26 | 27 | def __str__(self): 28 | message = self.message.format(returncode=self.returncode, cmd=self.cmd) 29 | if len(self.output.strip()): 30 | message += '\n%s' % self.output 31 | return message 32 | 33 | message = 'Command failed with code {returncode}: {cmd}' 34 | 35 | 36 | class CommandTimeoutError(CommandError): 37 | """CommandError which gets raised when a subprocess exceeds its timeout.""" 38 | 39 | pass 40 | 41 | 42 | class InvalidPipURL(LibVCSException): 43 | """Invalid pip-style URL.""" 44 | 45 | def __init__(self, url): 46 | self.url = url 47 | super(InvalidPipURL, self).__init__() 48 | 49 | def __str__(self): 50 | return self.message 51 | 52 | message = ( 53 | 'Repo URL %s requires a vcs scheme. Prepend the vcs (hg+, git+, svn+)' 54 | 'to the repo URL. e.g: git+https://github.com/freebsd/freebsd.git' 55 | ) 56 | 57 | 58 | class InvalidVCS(LibVCSException): 59 | """Invalid VCS.""" 60 | 61 | pass 62 | -------------------------------------------------------------------------------- /libvcs/hg.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Mercurial Repo object for libvcs. 3 | 4 | The following is from pypa/pip (MIT license): 5 | 6 | - [`MercurialRepo.get_url_and_revision_from_pip_url`](libvcs.hg.get_url_and_revision_from_pip_url) 7 | - [`MercurialRepo.get_url`](libvcs.hg.MercurialRepo.get_url) 8 | - [`MercurialRepo.get_revision`](libvcs.hg.MercurialRepo.get_revision) 9 | """ # NOQA E5 10 | from __future__ import absolute_import, print_function, unicode_literals 11 | 12 | import logging 13 | import os 14 | 15 | from .base import BaseRepo 16 | 17 | logger = logging.getLogger(__name__) 18 | 19 | 20 | class MercurialRepo(BaseRepo): 21 | bin_name = 'hg' 22 | schemes = ('hg', 'hg+http', 'hg+https', 'hg+file') 23 | 24 | def __init__(self, url, **kwargs): 25 | BaseRepo.__init__(self, url, **kwargs) 26 | 27 | def obtain(self): 28 | self.check_destination() 29 | 30 | self.run(['clone', '--noupdate', '-q', self.url, self.path]) 31 | self.run(['update', '-q']) 32 | 33 | def get_revision(self): 34 | return self.run(['--debug', 'id', '-i']).strip() 35 | 36 | def update_repo(self): 37 | self.check_destination() 38 | if not os.path.isdir(os.path.join(self.path, '.hg')): 39 | self.obtain() 40 | self.update_repo() 41 | else: 42 | self.run(['update']) 43 | self.run(['pull', '-u']) 44 | 45 | def checkout(self, revision): 46 | self.run(['revert', '-a', '-r', revision]) 47 | -------------------------------------------------------------------------------- /libvcs/shortcuts.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Shortcuts""" 3 | from __future__ import absolute_import, print_function, unicode_literals 4 | 5 | from libvcs import GitRepo, MercurialRepo, SubversionRepo 6 | from libvcs.exc import InvalidPipURL, InvalidVCS 7 | 8 | 9 | def create_repo(url, vcs, **kwargs): 10 | r"""Return a object representation of a VCS repository. 11 | 12 | Returns 13 | ------- 14 | `libvcs.svn.SubversionRepo`, `libvcs.git.GitRepo`, or `libvcs.hg.MercurialRepo`. 15 | 16 | Examples 17 | -------- 18 | 19 | >>> from libvcs.shortcuts import create_repo 20 | >>> 21 | >>> r = create_repo( 22 | ... url='https://www.github.com/you/myrepo', 23 | ... vcs='git', 24 | ... repo_dir='/tmp/myrepo' 25 | ... ) 26 | 27 | >>> r.update_repo() 28 | |myrepo| (git) Repo directory for myrepo (git) does not exist @ \ 29 | /tmp/myrepo 30 | |myrepo| (git) Cloning. 31 | |myrepo| (git) git clone https://www.github.com/tony/myrepo \ 32 | /tmp/myrepo 33 | Cloning into '/tmp/myrepo'... 34 | Checking connectivity... done. 35 | |myrepo| (git) git fetch 36 | |myrepo| (git) git pull 37 | Already up-to-date. 38 | """ 39 | if vcs == 'git': 40 | return GitRepo(url, **kwargs) 41 | elif vcs == 'hg': 42 | return MercurialRepo(url, **kwargs) 43 | elif vcs == 'svn': 44 | return SubversionRepo(url, **kwargs) 45 | else: 46 | raise InvalidVCS('VCS %s is not a valid VCS' % vcs) 47 | 48 | 49 | def create_repo_from_pip_url(pip_url, **kwargs): 50 | r"""Return a object representation of a VCS repository via pip-style url. 51 | 52 | Returns 53 | ------- 54 | `libvcs.svn.SubversionRepo`, `libvcs.git.GitRepo`, or `libvcs.hg.MercurialRepo`. 55 | 56 | Examples 57 | -------- 58 | 59 | >>> from libvcs.shortcuts import create_repo_from_pip_url 60 | 61 | >>> r = create_repo_from_pip_url( 62 | ... pip_url='git+https://www.github.com/you/myrepo', 63 | ... repo_dir='/tmp/myrepo') 64 | 65 | >>> r.update_repo() 66 | |myrepo| (git) Repo directory for myrepo (git) does not exist @ \ 67 | /tmp/myrepo 68 | |myrepo| (git) Cloning. 69 | |myrepo| (git) git clone https://www.github.com/tony/myrepo \ 70 | /tmp/myrepo 71 | Cloning into '/tmp/myrepo'... 72 | Checking connectivity... done. 73 | |myrepo| (git) git fetch 74 | |myrepo| (git) git pull 75 | Already up-to-date. 76 | """ 77 | if pip_url.startswith('git+'): 78 | return GitRepo.from_pip_url(pip_url, **kwargs) 79 | elif pip_url.startswith('hg+'): 80 | return MercurialRepo.from_pip_url(pip_url, **kwargs) 81 | elif pip_url.startswith('svn+'): 82 | return SubversionRepo.from_pip_url(pip_url, **kwargs) 83 | else: 84 | raise InvalidPipURL(pip_url) 85 | -------------------------------------------------------------------------------- /libvcs/svn.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | """Subversion object for libvcs. 4 | 5 | The follow are from saltstack/salt (Apache license): 6 | 7 | - [`SubversionRepo.get_revision_file`](libvcs.svn.SubversionRepo.get_revision_file) 8 | 9 | The following are pypa/pip (MIT license): 10 | 11 | - [`SubversionRepo.get_url_and_revision_from_pip_url`](libvcs.svn.SubversionRepo.get_url_and_revision_from_pip_url) 12 | - [`SubversionRepo.get_url`](libvcs.svn.SubversionRepo.get_url) 13 | - [`SubversionRepo.get_revision`](libvcs.svn.SubversionRepo.get_revision) 14 | - [`get_rev_options`](libvcs.svn.get_rev_options) 15 | """ # NOQA: E5 16 | from __future__ import absolute_import, print_function, unicode_literals 17 | 18 | import logging 19 | import os 20 | import re 21 | 22 | from ._compat import urlparse 23 | from .base import BaseRepo 24 | 25 | logger = logging.getLogger(__name__) 26 | 27 | 28 | class SubversionRepo(BaseRepo): 29 | bin_name = 'svn' 30 | schemes = ('svn', 'svn+ssh', 'svn+http', 'svn+https', 'svn+svn') 31 | 32 | def __init__(self, url, **kwargs): 33 | """A svn repository. 34 | 35 | Parameters 36 | ---------- 37 | url : str 38 | URL in subversion repository 39 | 40 | svn_username : str, optional 41 | username to use for checkout and update 42 | 43 | svn_password : str, optional 44 | password to use for checkout and update 45 | 46 | svn_trust_cert : bool 47 | trust the Subversion server site certificate, default False 48 | """ 49 | if 'svn_trust_cert' not in kwargs: 50 | self.svn_trust_cert = False 51 | 52 | self.rev = kwargs.get('rev') 53 | BaseRepo.__init__(self, url, **kwargs) 54 | 55 | def _user_pw_args(self): 56 | args = [] 57 | for param_name in ['svn_username', 'svn_password']: 58 | if hasattr(self, param_name): 59 | args.extend(['--' + param_name[4:], getattr(self, param_name)]) 60 | return args 61 | 62 | def obtain(self, quiet=None): 63 | self.check_destination() 64 | 65 | url, rev = self.url, self.rev 66 | 67 | cmd = ['checkout', '-q', url, '--non-interactive'] 68 | if self.svn_trust_cert: 69 | cmd.append('--trust-server-cert') 70 | cmd.extend(self._user_pw_args()) 71 | cmd.extend(get_rev_options(url, rev)) 72 | cmd.append(self.path) 73 | 74 | self.run(cmd) 75 | 76 | def get_revision_file(self, location): 77 | """Return revision for a file.""" 78 | 79 | current_rev = self.run(['info', location]) 80 | 81 | _INI_RE = re.compile(r"^([^:]+):\s+(\S.*)$", re.M) 82 | 83 | info_list = _INI_RE.findall(current_rev) 84 | return int(dict(info_list)['Revision']) 85 | 86 | def get_revision(self, location=None): 87 | try: 88 | ret = self.run(['info', '--show-item', 'revision']) 89 | return ret.strip() 90 | except exc.LibVCSException: 91 | return None 92 | 93 | @classmethod 94 | def get_url_and_revision_from_pip_url(cls, pip_url): 95 | # hotfix the URL scheme after removing svn+ from svn+ssh:// re-add it 96 | url, rev = super(SubversionRepo, cls).get_url_and_revision_from_pip_url(pip_url) 97 | if url.startswith('ssh://'): 98 | url = 'svn+' + url 99 | return url, rev 100 | 101 | def update_repo(self, dest=None): 102 | self.check_destination() 103 | if os.path.isdir(os.path.join(self.path, '.svn')): 104 | dest = self.path if not dest else dest 105 | 106 | url, rev = self.url, self.rev 107 | 108 | cmd = ['update'] 109 | cmd.extend(self._user_pw_args()) 110 | cmd.extend(get_rev_options(url, rev)) 111 | 112 | self.run(cmd) 113 | else: 114 | self.obtain() 115 | self.update_repo() 116 | 117 | def get_remote(self): 118 | try: 119 | ret = self.run(['info', '--show-item', 'url']) 120 | return ret.strip() 121 | except exc.LibVCSException: 122 | return None 123 | 124 | def checkout(self, revision): 125 | self.run(['up', '-r'+revision]) 126 | self.run(['revert', '--recursive', '.']) 127 | 128 | def get_rev_options(url, rev): 129 | """Return revision options. From pip pip.vcs.subversion.""" 130 | if rev: 131 | rev_options = ['-r', rev] 132 | else: 133 | rev_options = [] 134 | 135 | r = urlparse.urlsplit(url) 136 | if hasattr(r, 'username'): 137 | # >= Python-2.5 138 | username, password = r.username, r.password 139 | else: 140 | netloc = r[1] 141 | if '@' in netloc: 142 | auth = netloc.split('@')[0] 143 | if ':' in auth: 144 | username, password = auth.split(':', 1) 145 | else: 146 | username, password = auth, None 147 | else: 148 | username, password = None, None 149 | 150 | if username: 151 | rev_options += ['--username', username] 152 | if password: 153 | rev_options += ['--password', password] 154 | return rev_options 155 | -------------------------------------------------------------------------------- /libvcs/util.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Utility functions for libvcs.""" 3 | from __future__ import absolute_import, print_function, unicode_literals 4 | 5 | import datetime 6 | import errno 7 | import logging 8 | import os 9 | import subprocess 10 | 11 | from . import exc 12 | from ._compat import console_to_str 13 | 14 | logger = logging.getLogger(__name__) 15 | 16 | 17 | def which( 18 | exe=None, default_paths=['/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin'] 19 | ): 20 | """Return path of bin. Python clone of /usr/bin/which. 21 | 22 | from salt.util - https://www.github.com/saltstack/salt - license apache 23 | 24 | Parameters 25 | ---------- 26 | exe : str 27 | Application to search PATHs for. 28 | default_path : list 29 | Application to search PATHs for. 30 | 31 | Returns 32 | ------- 33 | str : 34 | Path to binary 35 | """ 36 | 37 | def _is_executable_file_or_link(exe): 38 | # check for os.X_OK doesn't suffice because directory may executable 39 | return os.access(exe, os.X_OK) and (os.path.isfile(exe) or os.path.islink(exe)) 40 | 41 | if _is_executable_file_or_link(exe): 42 | # executable in cwd or fullpath 43 | return exe 44 | 45 | # Enhance POSIX path for the reliability at some environments, when 46 | # $PATH is changing. This also keeps order, where 'first came, first 47 | # win' for cases to find optional alternatives 48 | search_path = ( 49 | os.environ.get('PATH') and os.environ['PATH'].split(os.pathsep) or list() 50 | ) 51 | for default_path in default_paths: 52 | if default_path not in search_path: 53 | search_path.append(default_path) 54 | os.environ['PATH'] = os.pathsep.join(search_path) 55 | for path in search_path: 56 | full_path = os.path.join(path, exe) 57 | if _is_executable_file_or_link(full_path): 58 | return full_path 59 | logger.info( 60 | '\'{0}\' could not be found in the following search path: ' 61 | '\'{1}\''.format(exe, search_path) 62 | ) 63 | 64 | return None 65 | 66 | 67 | def mkdir_p(path): 68 | """Make directories recursively. 69 | 70 | Parameters 71 | ---------- 72 | path : str 73 | path to create 74 | """ 75 | try: 76 | os.makedirs(path) 77 | except OSError as exc: # Python >2.5 78 | if exc.errno == errno.EEXIST and os.path.isdir(path): 79 | pass 80 | else: 81 | raise Exception('Could not create directory %s' % path) 82 | 83 | 84 | class RepoLoggingAdapter(logging.LoggerAdapter): 85 | 86 | """Adapter for adding Repo related content to logger. 87 | 88 | Extends `logging.LoggerAdapter`'s functionality. 89 | 90 | The standard library :py:mod:`logging` facility is pretty complex, so this 91 | warrants and explanation of what's happening. 92 | 93 | Any class that subclasses this will have its class attributes for: 94 | 95 | - :attr:`~.bin_name` -> ``repo_vcs`` 96 | - :attr:`~.repo_name` -> ``repo_name`` 97 | 98 | Added to a dictionary of context information in :py:meth:` 99 | logging.LoggerAdapter.process()` to be made use of when the user of this 100 | library wishes to use a custom :class:`logging.Formatter` to output 101 | results. 102 | """ 103 | 104 | def __init__(self, *args, **kwargs): 105 | logging.LoggerAdapter.__init__(self, *args, **kwargs) 106 | 107 | def process(self, msg, kwargs): 108 | """Add additional context information for loggers.""" 109 | prefixed_dict = {} 110 | prefixed_dict['repo_vcs'] = self.bin_name 111 | prefixed_dict['repo_name'] = self.repo_name 112 | 113 | kwargs["extra"] = prefixed_dict 114 | 115 | return msg, kwargs 116 | 117 | 118 | def run( 119 | cmd, 120 | shell=False, 121 | cwd=None, 122 | log_in_real_time=True, 123 | check_returncode=True, 124 | callback=None, 125 | ): 126 | """Run 'cmd' in a shell and return the combined contents of stdout and 127 | stderr (Blocking). Throws an exception if the command exits non-zero. 128 | 129 | Parameters 130 | ---------- 131 | cmd : list or str, or single str, if shell=True 132 | the command to run 133 | 134 | shell : boolean 135 | boolean indicating whether we are using advanced shell 136 | features. Use only when absolutely necessary, since this allows a lot 137 | more freedom which could be exploited by malicious code. See the 138 | warning here: 139 | http://docs.python.org/library/subprocess.html#popen-constructor 140 | 141 | cwd : str 142 | dir command is run from. Defaults to ``path``. 143 | 144 | log_in_real_time : boolean 145 | boolean indicating whether to read stdout from the 146 | subprocess in real time instead of when the process finishes. 147 | 148 | check_returncode : bool 149 | Indicate whether a `libvcs.exc.CommandError` should be raised if return code is 150 | different from 0. 151 | 152 | callback : callable 153 | callback to return output as a command executes, accepts a function signature 154 | of `(output, timestamp)`. Example usage:: 155 | 156 | def progress_cb(output, timestamp): 157 | sys.stdout.write(output) 158 | sys.stdout.flush() 159 | run(['git', 'pull'], callback=progrses_cb) 160 | """ 161 | proc = subprocess.Popen( 162 | cmd, 163 | shell=shell, 164 | stderr=subprocess.PIPE, 165 | stdout=subprocess.PIPE, 166 | cwd=cwd, 167 | ) 168 | 169 | all_output = [] 170 | code = None 171 | line = None 172 | while code is None: 173 | code = proc.poll() 174 | 175 | # output = console_to_str(proc.stdout.readline()) 176 | # all_output.append(output) 177 | if callback and callable(callback): 178 | line = console_to_str(proc.stderr.read(128)) 179 | if line: 180 | callback(output=line, timestamp=datetime.datetime.now()) 181 | if callback and callable(callback): 182 | callback(output='\r', timestamp=datetime.datetime.now()) 183 | 184 | lines = filter(None, (line.strip() for line in proc.stdout.readlines())) 185 | all_output = console_to_str(b'\n'.join(lines)) 186 | if code: 187 | stderr_lines = filter(None, (line.strip() for line in proc.stderr.readlines())) 188 | all_output = console_to_str(b''.join(stderr_lines)) 189 | output = ''.join(all_output) 190 | if code != 0 and check_returncode: 191 | raise exc.CommandError(output=output, returncode=code, cmd=cmd) 192 | return output 193 | -------------------------------------------------------------------------------- /scripts/package-windows.sh: -------------------------------------------------------------------------------- 1 | cd ${OUTPUT_DIR}${INSTALL_PREFIX} 2 | mkdir -p lib 3 | 4 | rm -rf ${OUTPUT_DIR}/dev 5 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/include/ghdl 6 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/yosys 7 | 8 | cp ${PATCHES_DIR}/${README} ${OUTPUT_DIR}${INSTALL_PREFIX}/README 9 | sed "s|___BRANDING___|${BRANDING}|g" -i ${OUTPUT_DIR}${INSTALL_PREFIX}/environment.bat 10 | sed "s|___BRANDING___|${BRANDING}|g" -i ${OUTPUT_DIR}${INSTALL_PREFIX}/environment.ps1 11 | 12 | if [ -f "${OUTPUT_DIR}${INSTALL_PREFIX}/bin/tabbyadm" ]; then 13 | sed "s|___BRANDING___|${BRANDING}|g" -i ${OUTPUT_DIR}${INSTALL_PREFIX}/bin/tabbyadm 14 | fi 15 | 16 | # We copy all DLLs that we are using 17 | cp /usr/x86_64-w64-mingw32/sys-root/mingw/bin/*.dll lib/. 18 | # Replace symbolic links with actual files 19 | for f in $(find . -type l) 20 | do 21 | cp --remove-destination $(readlink -e $f) $f 22 | done 23 | 24 | # Replace python scripts with python launchers 25 | for script in bin/* py3bin/*; do 26 | if $(head -1 "${script}" | grep -q python); then 27 | if [[ $script == *-script.py ]]; then 28 | cp ${OUTPUT_DIR}${INSTALL_PREFIX}/win-launcher.exe ${script/-script.py/.exe} 29 | else 30 | mv ${script} ${script/.py/}-script.py 31 | cp ${OUTPUT_DIR}${INSTALL_PREFIX}/win-launcher.exe ${script/.py/}.exe 32 | fi 33 | fi 34 | done 35 | 36 | if [ -d "py3bin" ]; then 37 | cp -f py3bin/* lib/. 38 | rm -rf py3bin 39 | fi 40 | 41 | # Remove general purpose launcher 42 | rm -rf ${OUTPUT_DIR}${INSTALL_PREFIX}/win-launcher.exe 43 | 44 | chmod -R u=rwX,go=rX * 45 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | --------------------------------------------------------------------------------