brew install subversion 1.7

由于公司開(kāi)發(fā)使用的SVN,而Mac 帶的svn是1.8的。
工作目錄管理時(shí)蜈出,只能通過(guò)第三方app進(jìn)行,brew中搜索沒(méi)有svn 1.7的帚呼,只有1.8掏缎。
故自己進(jìn)行了一些配置安裝的svn1.7皱蹦,現(xiàn)在可以使用terminal進(jìn)行操作。

步驟如下:

  • brew中添加suv1.7眷蜈。


    image.png

    進(jìn)入homebrew的git目錄(這里存放的是brew下各種軟件的配置文件)
    添加subversion@1.7.10.rb 文件沪哺,內(nèi)容如下:

require 'formula'

class SubversionAT1710 < Formula
    homepage 'http://subversion.apache.org/'
    url 'http://archive.apache.org/dist/subversion/subversion-1.7.10.tar.bz2'
    sha256 'c1df222bec83d014d17785e2ceba6bc80962f64b280967de0285836d8d77a8e7'
    
    option :universal
    option 'java', 'Build Java bindings'
    option 'perl', 'Build Perl bindings'
    option 'ruby', 'Build Ruby bindings'
    option 'unicode-path', 'Include support for OS X UTF-8-MAC filename'
    
    depends_on 'pkg-config' => :build
    
    depends_on "apr-util"
    depends_on "apr"
    
    # Always build against Homebrew versions instead of system versions for consistency.
    depends_on 'sqlite'
    depends_on 'serf'
    depends_on "python@2" => :optional
    
    # Building Ruby bindings requires libtool
    depends_on :libtool if build.include? 'ruby'
    
    # If building bindings, allow non-system interpreters
    env :userpaths if (build.include? 'perl') or (build.include? 'ruby')
    
    def patches
        ps = []
        
        # Patch for Subversion handling of OS X UTF-8-MAC filename.
        if build.include? 'unicode-path'
            ps << "https://raw.github.com/gist/3044094/1648c28f6133bcbb68b76b42669b0dc237c02dba/patch-path.c.diff"
        end
        
        # Patch to prevent '-arch ppc' from being pulled in from Perl's $Config{ccflags}
        if build.include? 'perl'
            ps << DATA
        end
        
        unless ps.empty?
            { :p0 => ps }
        end
    end
    
    # When building Perl or Ruby bindings, need to use a compiler that
    # recognizes GCC-style switches, since that's what the system languages
    # were compiled against.
    fails_with :clang do
    build 318
    cause "core.c:1: error: bad value (native) for -march= switch"
end if (build.include? 'perl') or (build.include? 'ruby')

def apr_bin
    "/usr/bin"
end

def install
    if build.include? 'java'
        unless build.universal?
            opoo "A non-Universal Java build was requested."
            puts "To use Java bindings with various Java IDEs, you might need a universal build:"
            puts "  brew install subversion --universal --java"
        end
        
        unless (ENV["JAVA_HOME"] or "").empty?
            opoo "JAVA_HOME is set. Try unsetting it if JNI headers cannot be found."
        end
    end
    
    ENV.universal_binary if build.universal?
    
    serf_prefix = libexec/"serf"
    
    # Use existing system zlib
    # Use dep-provided other libraries
    # Don't mess with Apache modules (since we're not sudo)
    args = ["--disable-debug",
    "--prefix=#{prefix}",
    "--with-ssl",
    "--with-zlib=/usr",
    "--with-sqlite=#{Formula['sqlite'].opt_prefix}",
    "--with-serf=#{serf_prefix}",
    "--without-neon",
    "--disable-mod-activation",
    "--disable-nls",
    "--without-apache-libexecdir",
    "--without-berkeley-db"]
    
    args << "--enable-javahl" << "--without-jikes" if build.include? 'java'
    
    if MacOS::CLT.installed? && MacOS.version < :sierra
        args << "--with-apr=/usr"
        args << "--with-apr-util=/usr"
        else
        args << "--with-apr=#{Formula["apr"].opt_prefix}"
        args << "--with-apr-util=#{Formula["apr-util"].opt_prefix}"
        args << "--with-apxs=no"
    end
    
    if build.include? 'ruby'
        args << "--with-ruby-sitedir=#{lib}/ruby"
        # Peg to system Ruby
        args << "RUBY=/usr/bin/ruby"
    end
    
    # The system Python is built with llvm-gcc, so we override this
    # variable to prevent failures due to incompatible CFLAGS
    ENV['ac_cv_python_compile'] = ENV.cc
    
    system "./configure", *args
    system "make"
    system "make install"
    bash_completion.install 'tools/client-side/bash_completion' => 'subversion'
    
    system "make tools"
    system "make install-tools"
    %w[
    svn-populate-node-origins-index
    svn-rep-sharing-stats
    svnauthz-validate
    svnmucc
    svnraisetreeconflict
    ].each do |prog|
        bin.install_symlink bin/"svn-tools"/prog
    end
    
    if build.with? "python@2"
        system "make", "swig-py"
        system "make", "install-swig-py"
        (lib/"python2.7/site-packages").install_symlink Dir["#{lib}/svn-python/*"]
    end
    
    if build.include? 'perl'
        # Remove hard-coded ppc target, add appropriate ones
        if build.universal?
            arches = "-arch x86_64 -arch i386"
            elsif MacOS.version == :leopard
            arches = "-arch i386"
            else
            arches = "-arch x86_64"
        end
        
        perl_core = Pathname.new(`perl -MConfig -e 'print $Config{archlib}'`)+'CORE'
        unless perl_core.exist?
            onoe "perl CORE directory does not exist in '#{perl_core}'"
        end
        
        inreplace "Makefile" do |s|
            s.change_make_var! "SWIG_PL_INCLUDES",
            "$(SWIG_INCLUDES) #{arches} -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -I#{perl_core}"
        end
        system "make swig-pl"
        system "make", "install-swig-pl", "DESTDIR=#{prefix}"
    end
    
    if build.include? 'java'
        system "make javahl"
        system "make install-javahl"
    end
    
    if build.include? 'ruby'
        # Peg to system Ruby
        system "make swig-rb EXTRA_SWIG_LDFLAGS=-L/usr/lib"
        system "make install-swig-rb"
    end
end

def caveats
    s = <<~EOS
    svntools have been installed to:
    #{opt_libexec}
    EOS
    
    if build.with? "perl"
        s += "\n"
        s += <<~EOS
        The perl bindings are located in various subdirectories of:
        #{prefix}/Library/Perl
        EOS
    end
    
    if build.with? "ruby"
        s += "\n"
        s += <<~EOS
        You may need to add the Ruby bindings to your RUBYLIB from:
        #{HOMEBREW_PREFIX}/lib/ruby
        EOS
    end
    
    if build.with? "java"
        s += "\n"
        s += <<~EOS
        You may need to link the Java bindings into the Java Extensions folder:
        sudo mkdir -p /Library/Java/Extensions
        sudo ln -s #{HOMEBREW_PREFIX}/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib
        EOS
    end
    
    s
end

test do
    system "#{bin}/svnadmin", "create", "test"
    system "#{bin}/svnadmin", "verify", "test"
end
end

__END__
--- subversion/bindings/swig/perl/native/Makefile.PL.in~    2011-07-16 04:47:59.000000000 -0700
+++ subversion/bindings/swig/perl/native/Makefile.PL.in 2012-06-27 17:45:57.000000000 -0700
@@ -57,10 +57,13 @@

chomp $apr_shlib_path_var;

+my $config_ccflags = $Config{ccflags};
+$config_ccflags =~ s/-arch\s+\S+//g; # remove any -arch arguments, since the ones we want will already be in $cflags
+
my %config = (
              ABSTRACT => 'Perl bindings for Subversion',
              DEFINE => $cppflags,
              -    CCFLAGS => join(' ', $cflags, $Config{ccflags}),
              +    CCFLAGS => join(' ', $cflags, $config_ccflags),
              INC  => join(' ',$apr_cflags, $apu_cflags,
                           " -I$swig_srcdir/perl/libsvn_swig_perl",

創(chuàng)建subverion@1.7.10.rb后,就可以直接執(zhí)行 brew install subversion@1.7.10酌儒。
等待成功后辜妓,就可以進(jìn)行命令行操作啦~~

image.png

如有其它問(wèn)題,請(qǐng)留言 !!!

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末忌怎,一起剝皮案震驚了整個(gè)濱河市籍滴,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌榴啸,老刑警劉巖孽惰,帶你破解...
    沈念sama閱讀 219,110評(píng)論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異鸥印,居然都是意外死亡勋功,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,443評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門(mén)库说,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)狂鞋,“玉大人,你說(shuō)我怎么就攤上這事潜的∩ё幔” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 165,474評(píng)論 0 356
  • 文/不壞的土叔 我叫張陵啰挪,是天一觀的道長(zhǎng)信不。 經(jīng)常有香客問(wèn)我,道長(zhǎng)亡呵,這世上最難降的妖魔是什么浑塞? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 58,881評(píng)論 1 295
  • 正文 為了忘掉前任,我火速辦了婚禮政己,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘掏愁。我一直安慰自己歇由,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,902評(píng)論 6 392
  • 文/花漫 我一把揭開(kāi)白布果港。 她就那樣靜靜地躺著沦泌,像睡著了一般。 火紅的嫁衣襯著肌膚如雪辛掠。 梳的紋絲不亂的頭發(fā)上谢谦,一...
    開(kāi)封第一講書(shū)人閱讀 51,698評(píng)論 1 305
  • 那天释牺,我揣著相機(jī)與錄音,去河邊找鬼回挽。 笑死没咙,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的千劈。 我是一名探鬼主播祭刚,決...
    沈念sama閱讀 40,418評(píng)論 3 419
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼墙牌!你這毒婦竟也來(lái)了涡驮?” 一聲冷哼從身側(cè)響起,我...
    開(kāi)封第一講書(shū)人閱讀 39,332評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤喜滨,失蹤者是張志新(化名)和其女友劉穎捉捅,沒(méi)想到半個(gè)月后,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體虽风,經(jīng)...
    沈念sama閱讀 45,796評(píng)論 1 316
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡棒口,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,968評(píng)論 3 337
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了焰情。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片陌凳。...
    茶點(diǎn)故事閱讀 40,110評(píng)論 1 351
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖内舟,靈堂內(nèi)的尸體忽然破棺而出合敦,到底是詐尸還是另有隱情,我是刑警寧澤验游,帶...
    沈念sama閱讀 35,792評(píng)論 5 346
  • 正文 年R本政府宣布充岛,位于F島的核電站,受9級(jí)特大地震影響耕蝉,放射性物質(zhì)發(fā)生泄漏崔梗。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,455評(píng)論 3 331
  • 文/蒙蒙 一垒在、第九天 我趴在偏房一處隱蔽的房頂上張望蒜魄。 院中可真熱鬧,春花似錦场躯、人聲如沸谈为。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 32,003評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)伞鲫。三九已至,卻和暖如春签舞,著一層夾襖步出監(jiān)牢的瞬間秕脓,已是汗流浹背柒瓣。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 33,130評(píng)論 1 272
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留吠架,地道東北人芙贫。 一個(gè)月前我還...
    沈念sama閱讀 48,348評(píng)論 3 373
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像诵肛,于是被迫代替她去往敵國(guó)和親屹培。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,047評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容