{"id":13579596,"url":"https://github.com/sabotage-linux/netbsd-curses","last_synced_at":"2026-01-23T01:56:35.773Z","repository":{"id":4027942,"uuid":"51722056","full_name":"sabotage-linux/netbsd-curses","owner":"sabotage-linux","description":"libcurses and dependencies taken from netbsd and brought into a portable shape (at least to musl or glibc)","archived":false,"fork":false,"pushed_at":"2024-01-16T19:32:23.000Z","size":1480,"stargazers_count":153,"open_issues_count":19,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-05T23:32:08.873Z","etag":null,"topics":["c","curses","linux","ncurses","netbsd-curses","portable"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sabotage-linux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-15T00:56:34.000Z","updated_at":"2025-02-05T21:25:35.000Z","dependencies_parsed_at":"2024-01-15T20:34:02.918Z","dependency_job_id":"1d7646a9-3d47-401f-ac12-25581a8c4e42","html_url":"https://github.com/sabotage-linux/netbsd-curses","commit_stats":{"total_commits":403,"total_committers":28,"mean_commits":"14.392857142857142","dds":0.7146401985111663,"last_synced_commit":"5874f9b1ced9c29d7d590d95e254b252f657a160"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/sabotage-linux/netbsd-curses","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabotage-linux%2Fnetbsd-curses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabotage-linux%2Fnetbsd-curses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabotage-linux%2Fnetbsd-curses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabotage-linux%2Fnetbsd-curses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sabotage-linux","download_url":"https://codeload.github.com/sabotage-linux/netbsd-curses/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabotage-linux%2Fnetbsd-curses/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28677714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"ssl_error","status_checked_at":"2026-01-23T01:00:19.529Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","curses","linux","ncurses","netbsd-curses","portable"],"created_at":"2024-08-01T15:01:40.934Z","updated_at":"2026-01-23T01:56:35.755Z","avatar_url":"https://github.com/sabotage-linux.png","language":"C","funding_links":[],"categories":["Utilities","C","公用事业"],"sub_categories":["YAML"],"readme":"netbsd-libcurses portable edition\n=================================\n\nthis is a port of netbsd's curses library for usage on Linux systems\n(tested and developed on sabotage linux, based on musl libc).\nIt should be possible to use on other POSIX platforms as well with minor\nchanges.\n\nit supports widechar (like the ncursesw build variant) and is close to being\na 100% feature-complete drop-in replacement for ncurses.\n\nto this date, there are only 3 implementations of the curses API:\n\n- the ubiquitous ncurses library, which is used on almost every UNIX system\n  (Linux, Mac OS X, FreeBSD, OpenBSD and others).\n- netbsd curses, previously used on netbsd only.\n- pdcurses, targetting the windows terminal, SDL and X11 (unusable on UNIX\n  terminals).\n\nWhy do we need an ncurses replacement ?\n---------------------------------------\n- Competition is good.\n- Ncurses is one of the most used libraries in the linux ecosystem and\n  therefore it's usually one of the first libraries built in a source-based\n  distro.\n  There's basically no way around it, unless you're building a single-purpose\n  appliance.\n- Readability/Hacking.\n  even though ncurses is free software, it is very hard to change its source\n  code:\n  - extremely complicated build process with several layers of preprocessing\n    using tools like awk, sed and the output of the C preprocessor with reliance\n    on implementation details, [as shown by the recent breakage when distros\n    updated to GCC 5][0].\n  - heavy use of macros, making the code hard to read.\n  - very much code (bloat).\n- Usability.\n  the default configuration of ncurses is usually not what one wants, and it\n  features several dozens of configure options to customize the build,\n  for example making it split up in several smaller libraries, with or without\n  widechar support, etc.\n\n  this makes it hard to guess which files to link against and which headers to\n  use when building a package against ncurses.\n  `-lncurses`? `-lncursesw -lterminfo -ltic`? `curses.h`? `ncurses/ncursesw.h`?\n  this filename chaos [is often fixed in a distro-specific manner][1].\n\n  to accomodate for this, ncurses ships its own config tool ncurses(w)5-config\n  instead of a standardized pkg-config description file (disabled by default)\n  to query the necessary CFLAGS and LDFLAGS.\n  unfortunately like every other homebrewed pkg-config replacement, this config\n  utility was designed without cross-compilation in mind, so many packages\n  using ncurses and autoconf fail to cross-compile when unpatched.\n- Size and build time.\n\nTable 1: Comparison between ncurses and netbsd curses\n-----------------------------------------------------\n|                             | NCURSES      | NETBSD CURSES |\n|:----------------------------|:------------:|:-------------:|\n| Size of extracted source    | 15.8 MB      | 3.3 MB        |\n| Installed size              | 15.9 MB      | 1.3 MB        |\n| Installed size w/debuginfo  | 128.3 MB     | 19.9 MB       |\n| Build time (make -j2)       | 59 sec       | 9 sec         |\n| size of libncursesw.so      | 346 KB       | 150 KB        |\n| size of static linked nano  | 334 KB       | 288 KB        |\n\n  \n  when scaling up to more build jobs, it is expected that netbsd curses fares a\n  lot better since its Makefile is fully parallelizable, while ncurses spends a\n  lot of time in a single process executing the configure script.\n\nDifferences from ncurses\n------------------------\n- the structures used differ. some programs access ncurses structure members directly,\n  they must be patched to use a portable approach.\n- mouse handling is lacking. ncurses mouse handling routines are provided as no-op\n  macros, so software using it builds without having to patch it.\n- some rarely used functions like vidputs() are missing. users must be patched.\n- the terminfo database is compiled (via tic) into a binary database in CDB format.\n- \"only\" 510 color pairs are supported.\n- some functionality like tgetent() lives in libterminfo rather than in libcurses.\n  it may be necessary to add -lterminfo to LDFLAGS for packages using those functions.\n\nTODO\n----\n- installation of global terminfo db\n  (rather than just a small built-in, handpicked set)\n\nCompilation\n-----------\nnetbsd-curses ships without a configure script, and requires GNU make.\nvariables for compilation can be passed directly to make, or be saved into config.mak.\nrecognized variables are:\n\n- CC - the C compiler\n- HOSTCC - the C compiler used for host programs when crosscompiling.\n  if set, and different from CC, cross-compilation is assumed.\n- CFLAGS - flags for the compiler\n- CPPFLAGS - flags for the preprocessor\n- LDFLAGS - flags for the linker\n- PREFIX - filesystem prefix used for hardcoded paths and installation\n- DESTDIR - staging directory for installation\n\nexamples:\n\n    make CFLAGS=\"-Os -Wall -fPIC\" PREFIX=/usr/local -j4 all install\n    make CFLAGS=-O2 LDFLAGS=-static PREFIX=/usr all-static install-static\n\nexample config.mak:\n\n    CFLAGS = -O3 -Wall\n    PREFIX = /usr\n    DESTDIR = foo\n\nif you're using config.mak, you can just run `make \u0026\u0026 make install` and the\nvariables will be picked up automatically.\n\nthe `all` and `install` Makefile targets will build/install all programs,\nshared and static libs, and headers.\nthe `all-static` and `install-static` targets will build/install all programs,\nstatic libs, and headers.\nthe `all-dynamic` and `install-dynamic` targets will build/install all programs\nshared libs, and headers.\n\nthe `all` build can be sped up by putting `-fPIC` in CFLAGS.\nthis has the effect that the same object files will be used for the dynamic and\nstatic libs; otherwise they will be compiled twice with different CFLAGS.\n\nCompiled-in terminal database\n-----------------------------\nsupport for about a dozen common TERMs is built-in already. if you need one\nthat's not included, you can either add yours to `libterminfo/genterms` or\n`make terminfo/terminfo.cdb` and install the result to either\n`$PREFIX/share/terminfo.cdb` or `$HOME/.terminfo.cdb`.\n\nCompiling software against netbsd-curses\n----------------------------------------\nthe functionality that ncurses offers is usually (if not configured to split\ninto several separate libs) available in a single `libncurses` library.\nnetbsd-curses on the other hand has it always split into `libcurses` and\n`libterminfo`.\nthis difference requires to give the build system a hint that it needs to\nlink to both libcurses and libterminfo.\n\n- programs using pkg-config(1) automatically get the right options\n  due to the supplied .pc files.\n\n- for autoconf based software (using a configure script) it is usually\n  sufficient to invoke configure like this:\n\n    LIBS=\"-lcurses -lterminfo\" ./configure ...\n\n- for Makefile-only based build systems, it should be sufficient to add\n  the libs to LDFLAGS:\n\n    make LDFLAGS=\"-lcurses -lterminfo\" ...\n\nwith these instructions it is easy to compile the majority of ncurses apps\nwithout problems against netbsd-curses.\n\na small percentage of apps written for ncurses poke at internals and need\nlight patching:\n\n- [patch for midnight commander][2] - merged upstream as rev 38d4c655d\n- [patch for python 2.7.x and 3.6][3]\n\nif you have trouble compiling a specific package, first look at the\n[sabotage linux build recipes][4].\nif you still can't get the package to compile, feel free to open an issue\n[at the netbsd-curses issue tracker][5].\n\nLicense\n-------\nlibcurses, tset and tput are (C) 1980-1994\n\"The Regents of the University of California\" licensed under the 3-clause BSD\nlicense.\nEverything else is (C) 1999-2016 The NetBSD Foundation, Inc. and Contributors,\nlicensed under the 2-clause BSD license.\nsee COPYING for the full text, and in doubt, consult the copyright clauses in\nthe respective .c files. Files without copyright clauses in the file header\nare explicitly released under the terms of the 2-clause BSD license as well.\n\n\nAPPENDIX A: Test Setup used for comparison in Table 1\n-----------------------------------------------------\nAll tests were done on a dual core x86_64 sabotage linux system, with the following\nfeatures:\ninstallation of shared and static libs, headers, etc,\ni.e. make -j2 all install.\nncurses and netbsd curses were both configured with support for widechars, and\nbuilt-in terminfo database for a handful of terminals.\n\n    CFLAGS (optimized for size):\n    -g0 -fdata-sections -ffunction-sections -Os -fno-unwind-tables\n    -fno-asynchronous-unwind-tables -Wa,--noexecstack\n\n    LDFLAGS:\n    -s -Wl,--gc-sections -Wl,-z,relro,-z,now\n\nnetbsd curses was installed without manpages (ncurses: 1.1 MB) and terminfo\ndatabase (ncurses: 6.4MB).\nthe debug info build was created with -g3 and debuginfo stripped into external\nfiles via objcopy.\n\nAPPENDIX B: History of NetBSD curses\n------------------------------------\n\nThomas Dickey did a [thorough investigation][6] on the history of NetBSD curses.\n\n\n[0]:http://trac.sagemath.org/ticket/18301\n[1]:https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/scripts/kconfig/lxdialog/check-lxdialog.sh\n[2]:https://github.com/MidnightCommander/mc/commit/38d4c655d322837574e957b4a824f4a0d1bb3b86\n[3]:https://github.com/sabotage-linux/sabotage/blob/06a4a815/KEEP/python2710-curses.patch\n[4]:https://github.com/sabotage-linux/sabotage/tree/master/pkg\n[5]:https://github.com/sabotage-linux/netbsd-curses/issues\n[6]:http://invisible-island.net/ncurses/ncurses-netbsd.html\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabotage-linux%2Fnetbsd-curses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsabotage-linux%2Fnetbsd-curses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabotage-linux%2Fnetbsd-curses/lists"}