ID: |
7399
|
Fixed in: |
|
Issue Date: |
2019-12-18 15:00 AEST
|
Owner: | CVS Support
|
Last Modified: | 2024-06-22 11:58 AEST | Reporter: | Arthur Barrett
|
Current Est. | 0.0 hours
| % Complete: | 0.0
|
Status: | NEW /
|
Severity: | normal
|
Affected: | 2.8.01
|
Description: | Instructions for compiling CVS 1.12.x on MacOS High Sierra 10.13
|
Actions:
|
2019-12-18 15:00 AEST by Arthur Barrett - Even though CVS doesn't come pre-installed on MacOS - you can still download Apple's open source version
of CVS and compile pretty easily on a more recent version of MacOS, eg:
Download CVS from here:
https://opensource.apple.com/source/cvs/cvs-47/
This will get you the source and the patches.
I used this process (below) to compile OK.
Remember that you can't "cvs login" to :ext: - you'll get a segmentation fault. You need to use pre-shared
keys instead.
cd Documents
mkdir gnucvs
cd gnucvs
bzip2 -d cvs-1.12.13.tar.bz2
tar xf cvs-1.12.13.tar
cd cvs-1.12.13
patch -p0 -F0 -i ../PR5178707.diff
patch -p0 -F0 -i ../endian.diff
patch -p0 -F0 -i ../i18n.diff
patch -p0 -F0 -i ../remove-info.diff
patch -p0 -F0 -i ../zlib.diff
patch -p0 -F0 -i ../fixtest-client-20.diff
patch -p0 -F0 -i ../initgroups.diff
patch -p0 -F0 -i ../remove-libcrypto.diff
patch -p0 -F0 -i ../ea.diff
patch -p0 -F0 -i ../fixtest-recase.diff
patch -p0 -F0 -i ../nopic.diff
patch -p0 -F0 -i ../tag.diff
tar czf ../cvs-1.12.13.tar.gz .
rm -rf ~/bin
./configure --prefix=/Users/abarrett/bin/ --with-gssapi --enable-pam --
enable-encryption --with-external-zlib --enable-case-sensitivity
--with-editor=vim ac_cv_func_working_mktime=no CFLAGS="-D_DARWIN_NO_64_BIT_INODE -
O3"
make
make install
~/bin/bin/cvs --version
Concurrent Versions System (CVS) 1.12.13 (client/server)
Copyright (C) 2005 Free Software Foundation, Inc.
Senior active maintainers include Larry Jones, Derek R. Price,
and Mark D. Baushke. Please see the AUTHORS and README files from the CVS
distribution kit for a complete list of contributors and copyrights.
CVS may be copied only under the terms of the GNU General Public License,
a copy of which can be found with the CVS distribution kit.
Specify the --help option for further information about CVS |
|
2020-05-01 21:32 AEST by Arthur Barrett - it wouldn't commit anything!
there is a bug in the implementation of error() src/error.c
It uses lib/vasnprintf.c which is just way overcomplex.
I created this simpler version which fixes it:
void
error (int status, int errnum, const char *message, ...)
{
va_list va;
int save_errno = errno;
size_t length;
/* Various buffers we attempt to use to generate the error message. */
char statcmdbuf[32];
char *cmdbuf;
char *emptybuf = "";
static const char *last_message = NULL;
static int last_status;
static int last_errnum;
/* Expand the cvs commmand name to <cmd> or [<cmd> aborted].
*
* I could squeeze this into the buf2 printf below, but this makes the code
* easier to read and I don't think error messages are printed often enough
* to make this a major performance hit. I think the memory cost is about
* 40 bytes.
*/
if (cvs_cmd_name)
{
length = sizeof (statcmdbuf);
cmdbuf = asnprintf (statcmdbuf, &length, " %s%s%s",
status ? "[" : "",
cvs_cmd_name,
status ? " aborted]" : "");
/* Else cmdbuf still = emptybuf. */
if (!cmdbuf) return;
}
/* Else cmdbuf still = emptybuf. */
/* Now put it all together. */
va_start (va, message);
fprintf (stderr,"%s%s: ",program_name, cmdbuf);
vfprintf (stderr, message, va);
fprintf (stderr,"%s%s\n",errnum ? ": " : "", errnum ? strerror (errnum) : "");
va_end (va);
/* Done, if we're exiting. */
if (status)
exit (EXIT_FAILURE);
if (cmdbuf != statcmdbuf && cmdbuf != emptybuf) free (cmdbuf);
/* Restore errno per our charter. */
errno = save_errno;
/* Done. */
return;
}
|
|
2021-04-20 00:07 AEST by Arthur Barrett - trying on macOS Catalina 10.15.7:
cd ~/Documents
mkdir gnucvs
cd gnucvs
cp ~/Downloads/cvs-1.12.13.tar.bz2 .
bzip2 -d cvs-1.12.13.tar.bz2
tar xf cvs-1.12.13.tar
curl https://opensource.apple.com/source/cvs/cvs-47/patches/PR5178707.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/PR5178707.diff > PR5178707.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/endian.diff > endian.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/i18n.diff > i18n.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/remove-info.diff > remove-info.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/zlib.diff > zlib.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/fixtest-client-20.diff > fixtest-client-20.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/initgroups.diff > initgroups.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/remove-libcrypto.diff > remove-libcrypto.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/ea.diff > ea.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/fixtest-recase.diff > fixtest-recase.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/nopic.diff > nopic.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/tag.diff > tag.diff
cd cvs-1.12.13
patch -p0 -F0 -i ../PR5178707.diff
patch -p0 -F0 -i ../endian.diff
patch -p0 -F0 -i ../i18n.diff
patch -p0 -F0 -i ../remove-info.diff
patch -p0 -F0 -i ../zlib.diff
patch -p0 -F0 -i ../fixtest-client-20.diff
patch -p0 -F0 -i ../initgroups.diff
patch -p0 -F0 -i ../remove-libcrypto.diff
patch -p0 -F0 -i ../ea.diff
patch -p0 -F0 -i ../fixtest-recase.diff
patch -p0 -F0 -i ../nopic.diff
patch -p0 -F0 -i ../tag.diff
tar czf ../cvs-1.12.13.tar.gz .
rm -rf ~/bin
sudo xcodebuild -license
./configure --prefix=/Users/abarrett/bin/ --with-gssapi --enable-pam --enable-
encryption --with-external-zlib --enable-case-sensitivity --with-editor=vim
ac_cv_func_working_mktime=no CFLAGS="-D_DARWIN_NO_64_BIT_INODE -O3"
fix the definition of calloc() and malloc() in subr.c:
vi src/subr.c
remove the #define for UNIQUE_INT_TYPE_PTRDIFF_T in config.h:
vi src/subr.c
vi config.h
make
make install
export PATH=/Users/abarrett/bin/bin:$PATH
~/bin/bin/cvs --version
Concurrent Versions System (CVS) 1.12.13 (client/server)
Copyright (C) 2005 Free Software Foundation, Inc.
Senior active maintainers include Larry Jones, Derek R. Price,
and Mark D. Baushke. Please see the AUTHORS and README files from the CVS
distribution kit for a complete list of contributors and copyrights.
CVS may be copied only under the terms of the GNU General Public License,
a copy of which can be found with the CVS distribution kit.
Specify the --help option for further information about CVS
that all compiles OK, but it crashes with every command:
cvs -ttt status
-> main: Session ID is GMB7Tdg7C41U1UPC
zsh: abort cvs -ttt status
cat ~/.zprofile
#!/bin/zsh
CVS_RSH="ssh"; export CVS_RSH
export PATH=$HOME/bin/bin:$HOME/bin:$PATH
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
#export PATH="$HOME/.cargo/bin:$PATH"
There are two problems - the asnprintf() in macOS Catalina seems broken, so the error.c code needs to be
re-written to use snprintf().
Also xgetcwd() is broken in macOS Catalina:
https://stackoverflow.com/questions/58329787/cvs-broken-on-macos-catalina-cannot-get-working-
directory
|
|
2021-10-14 22:31 AEST by CVS Support - trying on macOS Big Sur 11.6 / Xcode 13.0:
cd ~/Documents
mkdir gnucvs-2
cd gnucvs-2
ccp /Volumes/SabrentRocket/Users/abarrett/Downloads/cvs-1.12.13.tar.bz2 .
bzip2 -d cvs-1.12.13.tar.bz2
tar xf cvs-1.12.13.tar
curl https://opensource.apple.com/source/cvs/cvs-47/patches/PR5178707.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/PR5178707.diff > PR5178707.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/endian.diff > endian.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/i18n.diff > i18n.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/remove-info.diff > remove-info.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/zlib.diff > zlib.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/fixtest-client-20.diff > fixtest-client-20.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/initgroups.diff > initgroups.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/remove-libcrypto.diff > remove-libcrypto.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/ea.diff > ea.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/fixtest-recase.diff > fixtest-recase.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/nopic.diff > nopic.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/tag.diff > tag.diff
cd cvs-1.12.13
patch -p0 -F0 -i ../PR5178707.diff
patch -p0 -F0 -i ../endian.diff
patch -p0 -F0 -i ../i18n.diff
patch -p0 -F0 -i ../remove-info.diff
patch -p0 -F0 -i ../zlib.diff
patch -p0 -F0 -i ../fixtest-client-20.diff
patch -p0 -F0 -i ../initgroups.diff
patch -p0 -F0 -i ../remove-libcrypto.diff
patch -p0 -F0 -i ../ea.diff
patch -p0 -F0 -i ../fixtest-recase.diff
patch -p0 -F0 -i ../nopic.diff
patch -p0 -F0 -i ../tag.diff
tar czf ../../cvs-1.12.13-2.tar.gz .
rm -rf ~/bin
xcode-select --install
sudo xcodebuild -license
tar czf ../../cvs-1.12.13-3.tar.gz .
cp ~/Documents/gnucvs/cvs-1.12.13/src/error.c src/error.c
cp ~/Documents/gnucvs/cvs-1.12.13/config.h config.h
cp ~/Documents/gnucvs/cvs-1.12.13/lib/sighandle.c lib/sighandle.c
cp ~/Documents/gnucvs/cvs-1.12.13/lib/xgetcwd.c lib/xgetcwd.c
./configure --prefix=/Users/abarrett/bin/ --with-gssapi --enable-pam --enable-
encryption --with-external-zlib --enable-case-sensitivity --with-editor=vim
ac_cv_func_working_mktime=no CFLAGS="-D_DARWIN_NO_64_BIT_INODE -O3"
remove the #define for UNIQUE_INT_TYPE_PTRDIFF_T in config.h:
make
make install
export PATH=/Users/abarrett/bin/bin:$PATH
~/bin/bin/cvs --version
Concurrent Versions System (CVS) 1.12.13 (client/server)
Copyright (C) 2005 Free Software Foundation, Inc.
Senior active maintainers include Larry Jones, Derek R. Price,
and Mark D. Baushke. Please see the AUTHORS and README files from the CVS
distribution kit for a complete list of contributors and copyrights.
CVS may be copied only under the terms of the GNU General Public License,
a copy of which can be found with the CVS distribution kit.
Specify the --help option for further information about CVS
~/bin/bin/cvs :ext:abarrett@cvs.cvsnt.org:/usr/local/cvs rls
abarrett@coffeelakei9 cvs-1.12.13 % diff -c ~/Documents/gnucvs/cvs-1.12.13/lib/sighandle.c lib/sighandle.c
*** /Users/abarrett/Documents/gnucvs/cvs-1.12.13/lib/sighandle.c 2021-04-19 21:58:16.000000000 +1000
--- lib/sighandle.c 2003-10-05 13:49:29.000000000 +1000
***************
*** 41,51 ****
#include <stdlib.h>
#else
#if __STDC__
! void *calloc(size_t nelem, size_t size);
! void *malloc(size_t size);
#else
! void *calloc();
! void *malloc();
#endif /* __STDC__ */
#endif /* STDC_HEADERS */
--- 41,51 ----
#include <stdlib.h>
#else
#if __STDC__
! char *calloc(unsigned nelem, unsigned size);
! char *malloc(unsigned size);
#else
! char *calloc();
! char *malloc();
#endif /* __STDC__ */
#endif /* STDC_HEADERS */
abarrett@coffeelakei9 cvs-1.12.13 % diff -c ~/Documents/gnucvs/cvs-1.12.13/config.h config.h
*** /Users/abarrett/Documents/gnucvs/cvs-1.12.13/config.h 2021-04-19 22:02:49.000000000 +1000
--- config.h 2021-10-14 21:54:16.000000000 +1100
***************
*** 1052,1058 ****
/* #undef UNIQUE_INT_TYPE_LONG_LONG */
/* Define if ptrdiff_t is the first integer type detected with its size. */
! /* #define UNIQUE_INT_TYPE_PTRDIFF_T 1 */
/* Define if short is the first integer type detected with its size. */
#define UNIQUE_INT_TYPE_SHORT 1
--- 1052,1058 ----
/* #undef UNIQUE_INT_TYPE_LONG_LONG */
/* Define if ptrdiff_t is the first integer type detected with its size. */
! #define UNIQUE_INT_TYPE_PTRDIFF_T 1
/* Define if short is the first integer type detected with its size. */
#define UNIQUE_INT_TYPE_SHORT 1
abarrett@coffeelakei9 cvs-1.12.13 % diff -c ~/Documents/gnucvs/cvs-1.12.13/lib/xgetcwd.c lib/xgetcwd.c
*** /Users/abarrett/Documents/gnucvs/cvs-1.12.13/lib/xgetcwd.c 2021-04-19 23:57:43.000000000 +1000
--- lib/xgetcwd.c 2005-09-20 07:12:25.000000000 +1000
***************
*** 25,33 ****
#include "xgetcwd.h"
#include <errno.h>
- #include <unistd.h>
! /*#include "getcwd.h"*/
#include "xalloc.h"
/* Return the current directory, newly allocated.
--- 25,32 ----
#include "xgetcwd.h"
#include <errno.h>
! #include "getcwd.h"
#include "xalloc.h"
/* Return the current directory, newly allocated.
|
|
2022-11-02 21:46 AEST by Arthur Barrett - trying on (intel) Mac OS Big Sur 11.7.1 and Xcode 13.2.1:
Always remember that ~/.zshrc should set:
CVS_RSH="ssh"; export CVS_RSH
export PATH=$HOME/bin/bin:$HOME/bin:$PATH
export PYTHONPATH=$HOME/bin//lib/python2.7/site-packages/:$PYTHONPATH
xcodebuild -version && xcodebuild -showsdks
Xcode 13.2.1
Build version 13C100
DriverKit SDKs:
DriverKit 21.2 -sdk driverkit21.2
iOS SDKs:
iOS 15.2 -sdk iphoneos15.2
iOS Simulator SDKs:
Simulator - iOS 15.2 -sdk iphonesimulator15.2
macOS SDKs:
macOS 12.1 -sdk macosx12.1
tvOS SDKs:
tvOS 15.2 -sdk appletvos15.2
tvOS Simulator SDKs:
Simulator - tvOS 15.2 -sdk appletvsimulator15.2
watchOS SDKs:
watchOS 8.3 -sdk watchos8.3
watchOS Simulator SDKs:
Simulator - watchOS 8.3 -sdk watchsimulator8.3
curl -o cvs-1.12.13.tar.bz2 https://opensource.apple.com/source/cvs/cvs-47/cvs-1.12.13.tar.bz2
bzip2 -d cvs-1.12.13.tar.bz2
tar xf cvs-1.12.13.tar
curl https://opensource.apple.com/source/cvs/cvs-47/patches/PR5178707.diff > PR5178707.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/endian.diff > endian.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/i18n.diff > i18n.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/remove-info.diff > remove-info.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/zlib.diff > zlib.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/fixtest-client-20.diff > fixtest-client-20.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/initgroups.diff > initgroups.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/remove-libcrypto.diff > remove-libcrypto.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/ea.diff > ea.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/fixtest-recase.diff > fixtest-recase.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/nopic.diff > nopic.diff
curl https://opensource.apple.com/source/cvs/cvs-47/patches/tag.diff > tag.diff
cd cvs-1.12.13
patch -p0 -F0 -i ../PR5178707.diff
patch -p0 -F0 -i ../endian.diff
patch -p0 -F0 -i ../i18n.diff
patch -p0 -F0 -i ../remove-info.diff
patch -p0 -F0 -i ../zlib.diff
patch -p0 -F0 -i ../fixtest-client-20.diff
patch -p0 -F0 -i ../initgroups.diff
patch -p0 -F0 -i ../remove-libcrypto.diff
patch -p0 -F0 -i ../ea.diff
patch -p0 -F0 -i ../fixtest-recase.diff
patch -p0 -F0 -i ../nopic.diff
patch -p0 -F0 -i ../tag.diff
tar czf ../../cvs-1.12.13-2.tar.gz .
xcode-select --install
sudo xcodebuild -license
vi lib/sighandle.c
vi lib/xgetcwd.c
vi config.h.in
vi src/error.c
./configure --prefix=/Users/dev/bin --with-gssapi --enable-pam --enable-encryption --with-external-zlib
--enable-case-sensitivity --with-editor=vim ac_cv_func_working_mktime=no
CFLAGS="-D_DARWIN_NO_64_BIT_INODE -O3"
make
make install
~/bin/bin/cvs --version
~/bin/bin/cvs ver
void
error (int status, int errnum, const char *message, ...)
{
va_list va;
int save_errno = errno;
size_t length;
/* Various buffers we attempt to use to generate the error message. */
char statcmdbuf[32];
char *cmdbuf;
char *emptybuf = "";
static const char *last_message = NULL;
static int last_status;
static int last_errnum;
/* Expand the cvs commmand name to <cmd> or [<cmd> aborted].
*
* I could squeeze this into the buf2 printf below, but this makes the code
* easier to read and I don't think error messages are printed often enough
* to make this a major performance hit. I think the memory cost is about
* 40 bytes.
*/
if (cvs_cmd_name)
{
length = sizeof (statcmdbuf);
/*cmdbuf = asnprintf (statcmdbuf, &length, " %s%s%s",*/
snprintf (statcmdbuf, length, " %s%s%s",
status ? "[" : "",
cvs_cmd_name,
status ? " aborted]" : "");
cmdbuf=statcmdbuf;
/* Else cmdbuf still = emptybuf. */
if (!cmdbuf) TRACE (TRACE_FUNCTION, "error: cmdbufs NULL, return");
if (!cmdbuf) return;
}
/* Else cmdbuf still = emptybuf. */
/* Now put it all together. */
va_start (va, message);
fprintf (stderr,"%s%s: ",program_name, cmdbuf);
vfprintf (stderr, message, va);
fprintf (stderr,"%s%s\n",errnum ? ": " : "", errnum ? strerror (errnum) : "");
va_end (va);
/* Done, if we're exiting. */
if (status)
exit (EXIT_FAILURE);
if (cmdbuf != statcmdbuf && cmdbuf != emptybuf) free (cmdbuf);
/* Restore errno per our charter. */
errno = save_errno;
/* Done. */
return;
}
|
|
2024-06-22 11:58 AEST by Arthur Barrett - This built OK on MacOS X Sonoma 14.5 today.
The download is still available on opensource.apple.com but I just copied the same source I used previously
(with patches already applied) and did a distclean then configure & make.
I did this as a part of an attempt at making a CVS build environment for Mac OS X 10.13 to 14.5 aka High
Sierra to Sonoma. |
|